Is there any way in composer where we can add new Template into the hierarchy of Templates which is already created?
Not with the composer, but I did it before and it works:
This is not official, I've tested and worked without restarting Tomcat.
It wouldn't be possible through the Composer, however, what Carles described above should work (i.e,. manually editing exported xml file and then re-importing it back into the system - be careful with keeping the syntax, of course).
The workaround you suggested work and points out a possible bug , as the intent is not to change the base template for the design . Thingworx should work to fail to through validation if xml is edited manually . Just like java bytecodes if changed manually , compiler fails it.
I don't think "java laws" applies here, we are working with a live not compiled system ( scripting like ) which runs forever and restarts should be avoided as much as we can. Better to not to validate XML export/import, just validate if the structure and data it's ok, but not this kind of integrity you are pointing out.
Just my two cents and my point of view.
In that case , Thingworx should allow to manually change the base template from Composer . However it does not allow . The design Architect must come to defend their design. Because I don't thing there is any issues in changing it by editing export . They should tell why they have chosen , of not letting people edit it through composer.
Yes the Design Architect will defend their design, and he/she may want to change it also, and without the chance of modifying baseTemplate he/she will have a big problem.
As you can change ThingShapes with Composer, and think a good new feature would be the ability to chance also the baseThingTemplate, precisely on any language you can do it, you always can change the base class of an entity ( on the programing language side, of course then you have to compile on a compiled language, as Java for instance )
Just a note, I tried this a Thing Template that had 5 levels of inherited thing templates. The Thing Template replaced was at the higher level, and it worked fine until about three levels down from that template, it did not inherit the properties correctly anymore.
A simple example:
GenericThing Template inherited by Level0Template inherited by Level1Template inherited by Level2Template inherited by Level3Template inherited by Level4Template inherited by Level5Template --> Things created off of Level5Template
Level0Template was "replaced" by ReplacementTemplate as the BaseTemplate for Level1Template using the XML. The inheritance for the changed properties worked until Level3Template. At Level3Template, it was still showing the old properties, and this was also the case for Level4Template, Level5Template, and all the Things.
Solved this by running EntityServices>RestartDependenciesForThingTemplate on the ReplacementTemplate. This "refreshed" the dependencies for the template and the updated properties then showed correctly for Level3Template and down.
I hope this might help someone in the future!