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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Information on ThingStart event

SrijithKrish
12-Amethyst

Information on ThingStart event

Hi,

 

I had queries about the thingstart event. 

 

The query is when does this event get triggered?

 

I have a main template from which I am having 2-3 templates and I am having 2 things with each on these 2-3 templates. I am having a subscription which is using the thing start input in the super template or the main template from which the other templates are derived. I wanted to know that if I create a thing under an one of the template will this subscription go into action for all the things under the main template as in directly all the things are under this template and the subscription is written on it.

 

The structure is : 
'A' is the main template (subscription with thing start input is here)

'B' template under A

'C' template under A

'ThingB1' thing under template B

'ThingC1' thing under template C

 

Now if i make 'ThingB2' thing under template B will this subscription go into action for all the three things ('ThingB2', 'ThingB1', 'ThingC1') or just the newly created ThingB2?

 

Thanks in Advance

ACCEPTED SOLUTION

Accepted Solutions

Hi,
The ThingStart event is triggered for a Thing, as its name describes.
The behavior you described would imply that once a Thing starts (as a result of its creation in your case), then all the Things based on the same template would start again, which is not how the platform works.

I suggest to test this behavior in your ThingWorx Composer, it should not require more than 5 minutes.

View solution in original post

7 REPLIES 7

Hi,
The ThingStart event is triggered for a Thing, as its name describes.
The behavior you described would imply that once a Thing starts (as a result of its creation in your case), then all the Things based on the same template would start again, which is not how the platform works.

I suggest to test this behavior in your ThingWorx Composer, it should not require more than 5 minutes.

Thank You @VladimirRosu 

 

I just wanted to clarify the behavior as I believe that thing start event works as you have mentioned. Once had experienced a different behavior which will definitely be due to something else.

 

Exactly

Could you also tell me is there anything that would restart all the other things in a go?

As far as I remember, there is a snippet that restarts all things based on a template, called
Resources["EntityServices"].RestartDependenciesForThingTemplate(params);

Note: there's an almost identical service for ThingShape, named similarly.

Search it in the snippets section in a service and test it to be sure, as I haven't used it in a while.

If that does not work, a for loop where you manually call the RestartThing() should work equally well.

Thank You @VladimirRosu 

 

I do not wanna use them currently just wanted to make sure that I am not using them to show that kind of behavior.....

slangley
23-Emerald II
(To:SrijithKrish)

Hi @SrijithKrish.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in our community!

 

Regards.

 

--Sharon

Announcements


Top Tags