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

Issue with AddDynamicSubscription

Highlighted
Newbie

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
Highlighted

Re: Issue with AddDynamicSubscription

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.

Re: Issue with AddDynamicSubscription

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

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!