Skip to main content
1-Visitor
March 22, 2018
Solved

Things as Properties of Things / Array of Things Thing

  • March 22, 2018
  • 2 replies
  • 4954 views

Hello Everyone,

 

i am working on a scenario where 1000+ Things of the same type are being connected to the Thingworx Platform. My Question is, whether it is possible to create one Thing which contains other Things as Properties (Kind of a composed Design which is usual in OOP). 

 

I can imagine that this is a common scenario for IoT applications, but i wasn't able to find a solution for that. If it is not possible to have Things as properties, can you suggest another approach for this problem? 

 

Note: Mainly i want to avoid having 1000+ things shown in the composer.

 

Thanks in advance for your help. 

    Best answer by PaiChung

    Not sure what your use case is, but there are a variety of ways.

    1. Set it as the Home mashup in Organization

    then they can use <server>/Thingworx/FormLogin/NameOfOrganization to get to a landing page to login and be re-directed

    2. Set it as the Home mashup in the User

    then they can use <server>/Thingworx to get the login drop down and be re-directed

    3. Use <server>/Thingworx/Mashups/NameOfMashup this will directly give them access to the mashup in question after logging in through the drop down.

    2 replies

    22-Sapphire I
    March 22, 2018

    There isn't a way to do what you want unless

    1. you set visibility and the context you log in doesn't have visibility to those things, don't think that is a great idea

    2. tag everything else that you want to see with a tag and filter the composer view by tag

    drieder1-VisitorAuthor
    1-Visitor
    March 23, 2018

    Thats unfortunate. But maybe i have a wrong understanding of the workflow. Probably the User that wants to use the functionality of Thingworx won't work with the Composer won't he?

     

    Thanks for your reply. 

    22-Sapphire I
    March 23, 2018

    Correct, an end user would not user the Composer since it is the development IDE.

    An end user would use purpose created Mashups.

    drieder1-VisitorAuthor
    1-Visitor
    April 23, 2018

    I actually found out that you can define properties in a thing with the type "THINGNAME", which lets you choose a thing template or shape which this thing will contain.

     

    This approach allowed me to add multiple things to one thing and thus making composed/hierachical structures possible (e.g Thing Car can contain things of type "Engine", "Wheels" etc). Still i havent figured out how to have a single property be an array of things (e.g Property "Wheels" contains 4 Things).

     

     

    22-Sapphire I
    April 23, 2018

    Great!

    In the actual functionality I don't think that it gets you anything more than a regular string based property would except that composer limits your choices, but a Service writing the property won't limit it and would need validation.

    The way you are talking about this, I would say that perhaps a Network is a better way to go.

    For an array of items associated to a Thing directly, you could use the InfoTable property but I recommend to use that sparingly with a good knowledge of the size of the InfoTable because it will be information loaded into the JVM Memory.

    drieder1-VisitorAuthor
    1-Visitor
    April 23, 2018

    Nice, i will try out your approach 😉