Skip to main content
Apr 15, 2020 12:25 PM UTC
Solved

Thing Template and Dynamic Thing Template

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

PaiChungAnswer
Apr 15, 2020 2:02 PM UTC

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

PaiChungAnswer
Apr 15, 2020 2:02 PM UTC

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)

 

Apr 15, 2020 3:01 PM UTC

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? 

Apr 16, 2020 12:06 PM UTC

Correct!

Apr 27, 2020 5:50 PM UTC

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