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

Multiple inheritance (and its workaround)

bbeuckSIG
15-Moonstone

Multiple inheritance (and its workaround)

Dear community,

 

Thingworx does not support multiple inheritance of ThingTemplates. This alone is worth a feature request from my point of view but I doubt it would ever come and even if, I need it now.

 

I understand well that a Thing or ThingTemplate can use multiple ThingShapes, that's how it is designed. But there are situations where this is not enough.

Here my example: I want to create a FileRepository Thing which exports data on a scheduled time. I need FileRepository and Scheduler, both available as ThingTemplate, not ThingShape.

 

Of course I can create two separate Things, the Scheduler Thing can call the FileRepository Services at trigger time but I consider this an ugly workaround and I wonder whether you can offer me better solutions.

 

Thank you
Benny

1 ACCEPTED SOLUTION

Accepted Solutions
VladimirRosu
5-Regular Member
(To:bbeuckSIG)

Hello there,

 

You can achieve multiple inheritance by managing on your own the associations (eg, in a DataTable and not relying on the Template/Shape mechanism), that will still not give you the ideal "call from the same thing" capabilities (me.CallFileRepositoryService or me.CallSchedulerService).

I would suggest looking at the Extension SDK and see if you can somehow create a custom template that implements both types - I doubt that's possible, but worth checking out.

My suggestion: you can create a Scheduler template, eg: FileRepositoryScheduler, setup a property that holds the FileRepository name, and add an subscription that on tick will call the service you want, from the Thing referred in the FileRepository property.  Pack this template as an extension, and at least you can import it in any system, create the FileRepositoryScheduler Thing, then just create filerepositories and set their name there (which you can also pack in an Utility Thing in the extension).


Solution Architect @ Kalypso

View solution in original post

2 REPLIES 2
VladimirRosu
5-Regular Member
(To:bbeuckSIG)

Hello there,

 

You can achieve multiple inheritance by managing on your own the associations (eg, in a DataTable and not relying on the Template/Shape mechanism), that will still not give you the ideal "call from the same thing" capabilities (me.CallFileRepositoryService or me.CallSchedulerService).

I would suggest looking at the Extension SDK and see if you can somehow create a custom template that implements both types - I doubt that's possible, but worth checking out.

My suggestion: you can create a Scheduler template, eg: FileRepositoryScheduler, setup a property that holds the FileRepository name, and add an subscription that on tick will call the service you want, from the Thing referred in the FileRepository property.  Pack this template as an extension, and at least you can import it in any system, create the FileRepositoryScheduler Thing, then just create filerepositories and set their name there (which you can also pack in an Utility Thing in the extension).


Solution Architect @ Kalypso

View solution in original post

Hi @VladimirRosu ,

 

thanks for your suggestions.

 

The first idea is out for me, keeping track of the Service calls manually is too big for my simple use case.

 

I haven't worked with the Extension SDK so far but I may give it a shot.

 

As for the FileRepositoryScheduler this was also basically my idea but you enhanced it with the extension concept. Could be worthwhile but still it needs more than one single Thing. I will take it into account.

 

If there are no more suggestions I am willing to accept this as the solution.

 

Thanks again
Benny

Announcements