4 Replies Latest reply on Jul 25, 2016 9:31 AM by aanjan RSS
    ssolanke Newbie

    How to map data coming from EMS to multiple users?

    I am new to ThingWorx and want to create a good mashup from my first project.

    I am trying to implement a health monitoring app for my colleagues, where I want to monitor BP and pulse rate of each of my colleague and show the results on Thingworx mashup.

    The Mashup should contain list of the team members in left half of UI. If I click on name of any of team member, I should be able to see the data for that person in the right side. If no member is clicked, it should display the data of first member in the team.

     

    I have a ThingWorx EMS code from where I should be able to pass data of each team member and I should be able to map it to respective team member in the list.

    As of now, I am simulating these BP and pulse rate values in EMS and trying to pass it.

    In my EMS, I have following four properties binded to one Thing:

    1. Name:  BaseType = STRING
    2. BPVal: BaseType= NUMBER
    3. PulseVal:  BaseType=NUMBER
    4. Age : BaseType=NUMBER

     

    I am passing this data to my Thingworx composer where I have these four properties mapped to a thing I created here.

     

    I want to map Age, BPVal, PulseVal properties to be updated against each Name. like my name is Shreya and my colleagues name is Isha, so, Isha's vitals should be displayed against her name and my vitals should be displayed if  I click on my name.

     

     

     

    Now my questions are:

    1. How do I ensure this kind of mapping?
    2. Should I make use of Infotable? In that case, how would it help me?
    3. Should I write multiple things and pass data to each thing? in that case, how scalable this approach would be. Like what if I have to scale this for my entire company? WillI have to go and create 10K things?

     

     

     

     

    I am trying to solve this problem since many many days. I don't know if this is easy or tough.

    I am sure many of you already being experts in Thingworx must have solved this earlier.

     

    Please help me to resolve my issue and succeed in my first assignment itself.

      • Re: How to map data coming from EMS to multiple users?
        Sajid Patel Apprentice

        Disclaimer: This response contains my views and opinions expressed and not R&D's or company's.

         

        1.How do I ensure this kind of mapping?

           Each of your colleagues may be represented by a remote thing in the platform which is bound to a virtual thing in the edge SDK.

         

        2.Should I make use of Infotable? In that case, how would it help me?

           You can directly use the primitive properties. Infotable may be useful only if a single edge device is sending all the data. In such a scenario, you may use an infotable and then explode it to multiple things on platform. However, this will call for more code and it isn't as elegant as using primitive properties.

         

        3.Should I write multiple things and pass data to each thing? in that case, how scalable this approach would be. Like what if I have to scale this for my entire company? WillI have to go and create 10K things?

           Using multiple things should work. The scalability depends on how frequently the data will be refreshed. There are several ways to achieve the scalability, there are several discussions about it in thingworx community.

        • Re: How to map data coming from EMS to multiple users?
          aanjan Heavyweight Champ

          Shreya, since you're going to use four common properties across all users (Things, in this case), what you would need to do is use a ThingTemplate based on the RemoteThing. Any Thing you create based off this ThingTemplate is going to get (inherit) any properties or services attached to the ThingTemplate. You can add your four properties on a ThingShape as well, and then add that to the ThingTemplate (so the Things based on the Template would still get the properties).

           

          From a display perspective, since you have them based off a single Template, you can call a service like GetImplementingThings on the Template, which will list all the names and properties of Things based on the same. You can bind this to a list widget (to display the name and select the user) and use other widgets like the Gauge widget or a Shape widget to show the data.