Skip to main content
1-Visitor
August 26, 2016
Solved

Is it possible to detect when a user is created in Thingworx?

  • August 26, 2016
  • 7 replies
  • 3671 views

For example, is it possible to subscribe to an event (DataChange) that would notify a change to a user Name property, or any other mechanism?

Can it be done for any user, not just a specific user?

Best answer by mhollenbach

Gordon,

Some people do this by telling the new User to exercise a particular "helper" service that you have created for them upon logging in; kind of like steps to configure your ThingWorx experience. In that service you could construct these Dashboards for that User.

Meghan

7 replies

5-Regular Member
August 26, 2016

Gordon,

OOTB version of ThingWorx does not include an event that fires off to tell you when a new User is created. If you were to write a custom authenticator that would handle user creation then you could fire off a custom event that an entity in ThingWorx could then subscribe to and exercise a custom service when a new User is created.

Hope that helps.

Meghan

gfleming1-VisitorAuthor
1-Visitor
August 26, 2016

Thanks Meghan.  We are using a custom authenticator, but I am not sure I would want to burden the authenticator with the responsibility of creating the user.  What I want to accomplish is the creation of some objects when a user is created, in particular a dashboard.

5-Regular Member
August 26, 2016

Gordon, as Meghan noted there is no direct way to detect when a user is created. The closest you can get is by using a service like GetUserCount on the UserManagement Subsystem (to get a count of users) and then write a service to possibly monitor for any changes in count.

gfleming1-VisitorAuthor
1-Visitor
August 26, 2016

Thanks Aanjan. Unfortunately this would not work in my situation as I want to ensure the existence of a Dashboard for a user before the user views the mashup that displays the dashboard.  A polling solution would open the possibility that the user doesn't have a dashboard created before the next cycle occurs.

I believe I can accomplish this by subscribing to the LoginSucceeded event of SecurityMonitor, although it is not the ideal solution either.

5-Regular Member
August 26, 2016

Gordon,

Some people do this by telling the new User to exercise a particular "helper" service that you have created for them upon logging in; kind of like steps to configure your ThingWorx experience. In that service you could construct these Dashboards for that User.

Meghan