cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Issue with AddDynamicSubscription

jdurand
1-Visitor

Issue with AddDynamicSubscription

Hi,

I didn't find any relevant informations on the community so I open a new question.

I need to add subscriptions programatically on a thing so I tried to use AddDynamicSubscription like this :

var params = {

      propertyName: undefined /* STRING */,

      thingName: [Thing 1] /* THINGNAME */,

      eventName: "AnyDataChange" /* STRING */,

      serviceName: [Process Name on Thing 2] /* STRING */

};

Things[Thing 2].AddDynamicSubscription(params);

When I execute this service it returns no error but the newly created subscription does not appear in the subscription panel of ​Thing 2​ so I tried to execute EnableSubscription but it returns me an error : "There is no subscription for Thing1:AnyDataChange​".

And when I try to run AddDynamicSubscription again it says me : "There is already a subscription for Thing1:AnyDataChange"

2 REPLIES 2
posipova
20-Turquoise
(To:jdurand)

Hi, plaese understand that subscriptions added by AddDynamicSubscription are in-memory only, so they will not show up in composer at all

NOTE: If a Thing is edited or server is restarted then these Dynamic Subscription will be gone.

Ok, so how can I add static subscriptions or make dynamic sub. persistent ?

I tried to look the API but did not find relevant informations.

Announcements


Top Tags