Skip to main content
1-Visitor
June 26, 2019
Solved

Management the matching between user and thing

  • June 26, 2019
  • 13 replies
  • 3878 views

Hello everyone,

I concern about  a problem with the matching between user and Thing in Thingworx (For example: SIM/card management). Because the connection between user and Thing is one to one, so in the case there are a lot of things (e.g. 100 000 sim cards), then, I need to create 100 000 users and assign each thing to each user to ensure that other user can't see other thing in the Mashup. Hence, that is not a good ideal to do this because I need a lot of efforts to manage the users. I also think an other solution, that means create an unique "host" user in Thingworx for all user and an other database to store the user. When user login, I will authenticate with the database (use database extension) and if success, use the appKey of "host" user to load the mashup corresponding to the Thing connected to user (create a property named "username" and filter Thing by this property). But with this solution, I need to synchronous the appKey between Thingworx and my application. If the appKey is changed, I need to think far-away how to tell my app. Therefore, I am not sure it is an appropriate solution for my case or not. Are there anyone who have a similar use case with me ? I hope someone can share your experiments for this use case.

Also, because of the numerous connections can connect to the Platform by user, do you have the scalability for the web-service of Thingworx mashup ?

Best answer by CarlesColl

You can have different approaches to recover User's Thing if it's just one thing, here to sample approaches:

  • Add a user property with it's ThingName. You just need to edit the built-in UserExtensions ThingShape and add a property (let's call it, myThing), then on user creation you just need to add the user's thingName here, this property will be available on the Mashup at binding section under "User" sheet.
  • Add a HelperThing (it's just a Generic Thing created by you) with a custom Service which returns the User's ThingName based for instance on currentUser ( Resources["CurrentSessionInfo"].GetCurrentUser().

13 replies

22-Sapphire I
June 26, 2019

You can use Visibility instead for show/hide of Things to users.

1-Visitor
June 27, 2019

Hi PaiChung,

I don't get your ideal. I know the "Visibility" in "Permissions" option but in the first case as I mentioned in my question, if I create one user per one device, the number of user is huge. I can't create each Thing and assign each "Visibility" for user (I can't use user group in this case because I don't want other people, who is not owner of thing see this information. My case is mapping one to one, that means one Thing is belongs to one people and when user login, they can view only Thing which is assigned to them). Then, that is why I post my problem, because when I learn the course in PTC university, the problem is numerous devices (Things) but a few users in Thingworx. Hence, there are no difficulty to think about user management. But now, when I am in the face of problem which need mapping one user to one thing, I didn't find any suitable design of Thingworx for this case.

1-Visitor
June 27, 2019

I don't know where it's the difficulty with one thing one user and one visibility per user? you can automate everything. The only problem will be the load to the server but not automating thing/user creation.