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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

can we create thingshape from thing/thingtemplate ? If Yes, How ?

SwapnilP
12-Amethyst

can we create thingshape from thing/thingtemplate ? If Yes, How ?

I am aware of creating a thingtemplate from thing but not sure about thingshape.

ACCEPTED SOLUTION

Accepted Solutions

Well, not OOTB.

One reason is that Shapes do not have Templates themselves, therefore more things might be broken if you go from Thing to Shape:

When you create a template from a thing, that template will have the same parent template as the original thing.

This way all services provides by the things template hierarchy up to GenericThing are also available in the template. The services will most probably work (unless you hardcoded the thing name instead of using "me"), and all properties are there,

For Shapes it's more complicated - let's say your thing has two properties p1 and p2, while p2 is not defined on the thing, but on its template two levels up.

Now, the expectation is the shape should clearly have p1, but what about p2? Should it be in or not? Same is true for services, but they are even more complex as they may refer to the previous properties. This could lead to missing or even broken services. I think it's due to this complexity (which would need an own UI) that it's not OOTB functionality.

 

If you have to do it due to refactoring, so more or less a one time effort, I would export the thing's XML and copy over the sections to a shape you created. At least for the services.

 

 

View solution in original post

2 REPLIES 2

Well, not OOTB.

One reason is that Shapes do not have Templates themselves, therefore more things might be broken if you go from Thing to Shape:

When you create a template from a thing, that template will have the same parent template as the original thing.

This way all services provides by the things template hierarchy up to GenericThing are also available in the template. The services will most probably work (unless you hardcoded the thing name instead of using "me"), and all properties are there,

For Shapes it's more complicated - let's say your thing has two properties p1 and p2, while p2 is not defined on the thing, but on its template two levels up.

Now, the expectation is the shape should clearly have p1, but what about p2? Should it be in or not? Same is true for services, but they are even more complex as they may refer to the previous properties. This could lead to missing or even broken services. I think it's due to this complexity (which would need an own UI) that it's not OOTB functionality.

 

If you have to do it due to refactoring, so more or less a one time effort, I would export the thing's XML and copy over the sections to a shape you created. At least for the services.

 

 

SwapnilP
12-Amethyst
(To:Rocko)

Thank you @Rocko . It makes sense now. I will export the thing's XML and copy over the sections to a shape for now. 

Announcements


Top Tags