2 Replies Latest reply on Oct 26, 2012 8:02 AM by paic RSS
    vishp Explorer

    Session & persistence

    Have a couple of questions - a. Can we have session properties thing shape, one for each application ?   b. What is the best way to persist an info table or other data type by Thingworx user  ?  If user extension is the way to do it, is there a get/set built-in service to do that ?

      • Session & persistence
        tonyc Newbie

        a. You can define ThingShapes for any type of data, but the shapes are then used in templates / things. So this would work if you have a thing instance representing each application.

        b. Yes user extensions are the best way to persist user specific data. I believe the standard REST API's for getting and setting thing properties are then available to do this.  I will check this and find you an example in the morning. 

        • Session & persistence
          paic Collaborator

          Correct, user extensions (which can be customized in ThingShapes/UserExtensions) can be accessed by:

          1. For the currently logged in user, you can click on the User Tab in the Mashup builder Data Services pane, and bind the values to your widgets and services. (No service required)

          2. REST API Thingworx/Users/UserName/Properties/UserExtensionName

          3. In script Users['UserName'].UserExtension


          If in a Mashup, you need to get the properties for a specific user that is not the user logged in, you will need to build a service that returns the information.