Creating and Setting ValueStream programatically to a thing
- April 17, 2018
- 3 replies
- 3573 views
Hello,
I am creating a ValueStream programatically in a service using createThing function and assigning the same to a thing using setValueStream() function.
[Reference: https://community.ptc.com/t5/ThingWorx-Developers/How-to-create-Valuestream-with-script/td-p/515958]
I have taken the necessary precautions while assigning the value stream, such as verify that the thing is created and then performing enable and restart thing
[Reference: https://community.ptc.com/t5/ThingWorx-Developers/JavaScript-CreateThing-Thing-is-not-running/td-p/508232]
But some how when I see that thing in composer, I do not see the value stream attached to it, how ever when I call 'getValueStream' for that thing it returns me the valid value stream. I can see this on "Entity Depends on" for the thing to which value stream is assigned and also on "Uses this Entity" for the created value stream.
So I assume that value stream is successfully assigned, but I cannot see it when I view that thing in Composer as shown in attached image [IMAGE1] with red selection.
Is this expected behaviour?
Thanks in Advance
Aditya Mittal

