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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Add Value Stream to a extension Thing Template

hpulkkinen
1-Newbie

Add Value Stream to a extension Thing Template

I have a thing template which is defined in my extension. The template has some logged properties so it needs a value stream. How do I automatically include the valuestream to the extension so that I don't have to manually add it to all the things based on that thing template?

1 ACCEPTED SOLUTION

Accepted Solutions

On page 14 of the Thingworx Extension Developer Guide in the section "Contents of an Extension" it briefly mentions a way to export entities from the Composer and incorporate them into an Thingworx Extension SDK project. You can use this technique to mix entities defined in the Composer with entities defined in Java.

What I did was move all of the properties and services into ThingShapes that are defined in Java. Then, in the Composer, define a ThingTemplate that uses all of those ThingShapes AND uses a ValueStream. Use a model tag to tag the ThingTemplate and the ValueStream to make exporting them easier. Then include the exported ThingTemplate and ValueSteam in the extension project and rebuild.


After importing the extension, any Thing created using the imported ThingTemplate will start logging property values to the ValueStream.


It is a bumpy road to make this all work but it is doable.

View solution in original post

3 REPLIES 3
PaiChung
22-Sapphire I
(To:hpulkkinen)

I believe you should be able to define that in your extension, I've heard that it has been done, sorry but I'm not too familiar with the extension creation itself.

On page 14 of the Thingworx Extension Developer Guide in the section "Contents of an Extension" it briefly mentions a way to export entities from the Composer and incorporate them into an Thingworx Extension SDK project. You can use this technique to mix entities defined in the Composer with entities defined in Java.

What I did was move all of the properties and services into ThingShapes that are defined in Java. Then, in the Composer, define a ThingTemplate that uses all of those ThingShapes AND uses a ValueStream. Use a model tag to tag the ThingTemplate and the ValueStream to make exporting them easier. Then include the exported ThingTemplate and ValueSteam in the extension project and rebuild.


After importing the extension, any Thing created using the imported ThingTemplate will start logging property values to the ValueStream.


It is a bumpy road to make this all work but it is doable.

Thanks, that solved it!

I instead of exporting the thing template from the composer I decided just to export the things that I currently need.

Top Tags