Skip to main content
1-Visitor
April 15, 2020
Solved

Thing Template and Dynamic Thing Template

  • April 15, 2020
  • 4 replies
  • 1779 views

Hi

 

I have a doubt regarding Thing Templates, when I am using a thing template inside a mashup I am not able to get my custom services. But if I am using the thing templates by ticking the dynamic box then I am able to get my custom services. While using the custom services from the dynamic templates they are not working as written.

 

I would like to know the exact reason.

 

Thank You and Regards

Srijith

Best answer by PaiChung

All the custom services created on a ThingTemplate are considered to run in the context of an instantiated Thing.

So you will only see services that apply to a ThingTemplate itself when you select ThingTemplate - like GetImplementingThings (what things use this Template)

But when you set it to Dynamic, it becomes the context of an instantiated Thing that you specify through the Entity parameter, now you will see GetPropertyValues and your custom services (what are my thing property values)

 

4 replies

PaiChung22-Sapphire IAnswer
22-Sapphire I
April 15, 2020

All the custom services created on a ThingTemplate are considered to run in the context of an instantiated Thing.

So you will only see services that apply to a ThingTemplate itself when you select ThingTemplate - like GetImplementingThings (what things use this Template)

But when you set it to Dynamic, it becomes the context of an instantiated Thing that you specify through the Entity parameter, now you will see GetPropertyValues and your custom services (what are my thing property values)

 

1-Visitor
April 15, 2020

Hi @PaiChung 

 

Thank You!!

So dynamic template can be used if I need to access the instantiated Thing, right? If I will have to use a function that is general to all the things of the template I will have to make a thing outside the template referring the template properties or the template right? 

22-Sapphire I
April 16, 2020

Correct!

Support
April 27, 2020

Hi @SrijithKrish.

 

If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others in the community.

 

Regards.

 

--Sharon