Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I have a selection of Sensors for a User to choose. The User can create a grouping of whatever order of sensors, called a 'Scene'. These Scenes share the same SceneTemplate and the property that stores the Sensors they chose is an InfoTable, called "DeviceList".
I'm stuck on figuring out the best way to implement that. I assume I would have to create my own service.
The service I will need to make must access all implemented things of my SensorTemplate and also access the DeviceList of the User-selected Scene, and then access the properties of the Sensors, comparing which Sensors of SensorTemplate are and aren't inside DeviceList so their property can be correctly set On or Off.
I'm guessing it should be a service for my SensorTemplate and it wouldn't necessarily need a return value, but other than that I haven't found a useful tutorial for writing my own script for a service. For example, I know how to find the function "GetImplementedThings" for my SensorTemplate inside the script, but am unsure how I could use it's return value(InfoTable) to do further work in the script and eventually change property values.
Any kind of webpages, tutorials, or advice would be appreciated. Thank You
I recommend the Thingworx Fundamentals course.
Your explanation is somewhat complicated for me to understand exactly what you are doing, but sounds like you have a good idea and are on the right track.
Services are all javascript and Thingworx provides snippets and default services for you to be able to do what you need to do, either BI or in your case retrieval of 'assets' Each of these snippets and services and the services you create have return type, an InfoTable is basically an array and you can address information inside of it using result.name for example to get the entity name. (You can figure out the fields within it, by checking the datashape, or just testing the service)