Skip to main content
1-Visitor
September 15, 2015
Solved

ThingTemplate Service Calls - Things[ThingName] is not running

  • September 15, 2015
  • 4 replies
  • 2450 views

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?

Best answer by kramesh

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.....

4 replies

kramesh1-VisitorAnswer
1-Visitor
September 16, 2015

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.....

mattl11-VisitorAuthor
1-Visitor
September 16, 2015

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.

5-Regular Member
September 16, 2015

What Template is the 'equipmentTemplate' based on?