Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I'm creating entities for 100+ Machines where as each Machine has some common and unique information to be stored/accessed from DataTable. For creating DataShapes for those DataTables, there are 17 common attributes and as per Machine it may have 5-10 additional attributes.
If I could get a chance to create a template with the 17 common attribute which will eliminate unnecessary name changes, naming conventions and will help me to have neat and generic code style.
As of now I following one generic service to create datashape with 17 common fields by getting datashapeName as Input. In Future, if I eliminate or includes one common attribute, it will come to me as a rework for all the entities.
So, How can I avoid this? or Is there a possible way to have a DataShape template?
Please help.
Thank you,
Janakiraman P
Solved! Go to Solution.
One more thought building off of @TravisPickett 's idea is to Tag all of the datashapes that have your common datashape columns (with the same tag). Then when you want to add a "Common" column to all of them, write a service that queries all of the DataShapes with that tag and loops through them to add/delete common columns. That might actually be the easiest way to do it.
Hi @Janakiraman-P,
I understand the point of your request, however as of today DataShapes do not have the capability to implement templates/other DataShapes.
To request this functionality, refer to Product Ideas @ PTC Community
Thanks !
Hi @Janakiraman-P,
You can sort of accomplish this via code. You can create a "template" data shape and then create the additional data shapes by code.
In your service do the following:
Unfortunately if you have to make updates to the template data shape you will have make this manually to your other shapes or code the updates. For more assistance creating data shapes via code you can see the following community post.
Thanks,
Another way you could do this is having an InfoTable as one of your 'inherited' DataShape columns. In other words, create your base DataShape (I'll just call it CommonShape) and then for your 'inherited shapes', add an InfoTable column with the DataShape as CommonShape. Then it should keep up with any updates you make to CommonShape. The only downside that I can see is that you have to reach one level deeper in your infotable to get to the Common properties and it may preclude you from using it in some mashup widgets.
Hi @nmilleson @TravisPickett @c_lowy ,
Thanks for the responses,
@nmilleson I take your suggestion to try out the best I can do for this.
I have to validate on these,
1.I usually upload csv data as base data for my DataTable, in your case I should have two csv's to achieve this, I guess.
2.How data can be represented in Grid, Collection, Graphs and other such widgets are already in use.
3. Selected row's info..., and more.
Will come back, if any.
Thanks,
Janakiraman P
One more thought building off of @TravisPickett 's idea is to Tag all of the datashapes that have your common datashape columns (with the same tag). Then when you want to add a "Common" column to all of them, write a service that queries all of the DataShapes with that tag and loops through them to add/delete common columns. That might actually be the easiest way to do it.
Thanks for the suggestions, services approach might work I guess.
Regards,
Janakiraman P