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

How to create a subscription on a thing from within a script

SOLVED
sveneman
Visitor

How to create a subscription on a thing from within a script

Hello everyone, 

i want do add a subscription to a Thing from within a script but i don't seem to be able to do so. I have tried using EnableSubscription which is not what i'm looking for since it simply activates or disables an already existing subscription. I have also tried using AddDynamicSubscription but this subscription is only in-memory which is not what i want. Is there any way to just add a subscription to a thing from a script like you would when using the editor?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to create a subscription on a thing from within a script

Right now you can't use a script to create a persistent subscription.

Is there a reason why you need to create it dynamically?

What you can create persistently is Alerts so if you have standard handling, you can create alerts into a AnyAlert subscription.

If they have to be dynamic, then you will need to 

1. create them on demand

2. store the ones that you've created so they can be recreated during ThingStart

View solution in original post

1 REPLY 1

Re: How to create a subscription on a thing from within a script

Right now you can't use a script to create a persistent subscription.

Is there a reason why you need to create it dynamically?

What you can create persistently is Alerts so if you have standard handling, you can create alerts into a AnyAlert subscription.

If they have to be dynamic, then you will need to 

1. create them on demand

2. store the ones that you've created so they can be recreated during ThingStart

View solution in original post

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.