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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Can template inheritance be changed?

dsodling
5-Regular Member

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

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.

View solution in original post

5 REPLIES 5
mnarang
17-Peridot
(To:dsodling)

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

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.

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

dsodling
5-Regular Member
(To:dsodling)

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

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.

Top Tags