Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
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 ?
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.
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.