3 Replies Latest reply on Apr 12, 2016 9:47 AM by hpulkkinen RSS
    hpulkkinen Explorer

    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?

      • Re: Add Value Stream to a extension Thing Template
        pchung Collaborator

        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.

        • Re: Add Value Stream to a extension Thing Template
          asinclair-2 Apprentice

          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.