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

Can template inheritance be changed?

SOLVED
Highlighted
Participant

Can template inheritance be changed?

All,

is it possible to change the Base Thing Template of an existing template?


A customer has decided to split an existing template into two new templates and divide up the properties and services between the two. All existing things are based on one of these to we should be able to keep the based on the old template as long as we can change the Base Thing  Template of the old template to reference one of the new ones.


Is this possible to do?


Best regards

Daniel Södling

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Can template inheritance be changed?

Hi Mukul,

Good copy of the original post... :

Re: How can we modify the Base Template Of another Template or Thing in Thingworx Composer?

You must empower original content, not duplicate it.

Best Regards,

Carles.

5 REPLIES 5

Re: Can template inheritance be changed?

Daniel Södling

This is by Carles Coll​​ shared in a post : -

Officially it’s not possible as ThingWorx does not allow to change the base ThingTemplate once saved ,but if this is a need then an alternative is

  • Export the entity as XML ( Entity > More > Export )
  • Duplicate the XML file ( just in case... )
  • Edit the XML file with a text editor
    • Search for <ThingTemplate baseThingTemplate="originalBaseTemplate"
    • change "originalBaseTemplate" with the desired base template
  • Import the new XML ( Import/Export > From File > Entities > Single File )



Thanks

Mukul Narang

Re: Can template inheritance be changed?

Hi Mukul,

Good copy of the original post... :

Re: How can we modify the Base Template Of another Template or Thing in Thingworx Composer?

You must empower original content, not duplicate it.

Best Regards,

Carles.

Re: Can template inheritance be changed?

Carles Coll​ - Credit is yours only ,I actually learned it from your post only . I used it somehow long back.If you want i will remove my reply


Thanks ,

Mukul Narang

Re: Can template inheritance be changed?

Thanks a bunch, guys!

Apologies for not finding the post before asking my question.

I do have one or two followup questions:

Lets say that I am able to replace all instances of my old template with my new one I now assume that all mashups and other entities still can refer to services on the old template.

Is it possible to do the same thing here, that is export all entities and do a search and replace for my template name? Also is this enough, or can there be references to the template name in the data that has been stored?

Regards

Daniel

Re: Can template inheritance be changed?

Hi Daniel,

You can do the same for Mashups, but you will have to digg a bit into the XML to be sure you remplace everything.

But Mashups code it's less cumbersome rather than changing base ThingTemplate, which by the end you have instances in-memory on server side, but that's not true for Mashups content which are executed on Client Side.