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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

ThingTemplate Service Calls - Things[ThingName] is not running

mattl1
1-Newbie

ThingTemplate Service Calls - Things[ThingName] is not running

I have a problem with calling services from a thing that uses a particular ThingTemplate.

I am creating the Thing programmatically:

var params = {

             thingTemplateName: equipmentTemplate,

             description: description,

             name: equipmentName

             };

        Resources["EntityServices"].CreateThing(params);

        Things[equipmentName].EnableThing();

        Things[equipmentName].RestartThing();

Which works fine, but when I try to call a service from that Thing:

...

Things[equipmentName].AddVisibilityPermission(params);


Then it throws a Things[equipmentName] is not running error.

This only happens when using one particular ThingTemplate as the 'equipmentTemplate', all other templates 'run' fine.

Does any one know why this might be happening? I can't find any permission issues, spelling errors or anything in that ThingTemplate. We did just upgrade to 6.5 - Would that have anything to do with this one ThingTemplate?

1 ACCEPTED SOLUTION

Accepted Solutions
kramesh
1-Newbie
(To:mattl1)

Do you know if the RestartThing is completing?. and if so; when the new Thing is added and it shows up in server; can you then run your visibility permission service?. maybe it's timing issue.....

View solution in original post

4 REPLIES 4
kramesh
1-Newbie
(To:mattl1)

Do you know if the RestartThing is completing?. and if so; when the new Thing is added and it shows up in server; can you then run your visibility permission service?. maybe it's timing issue.....

mattl1
1-Newbie
(To:kramesh)

The RestartThing should be completing, I can warn the Thing[equipmentName].name afterward.

The thing is removed when the service is called because I have it in a trycatch as to not create any ghost things. So it doesn't actually show up on the server.

Aanjan
9-Granite
(To:mattl1)

What Template is the 'equipmentTemplate' based on?

mattl1
1-Newbie
(To:Aanjan)

Thanks for the help guys, it turns out it was a timing issue. A ThingStart subscription was being called, and I guess it didn't like that. Thanks!

Top Tags