Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
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?
Solved! Go to Solution.
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
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
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.
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.
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.
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
Yes, this is a variation of what I will do. Instead of asking the user to invoke the service. I will subscribe to SecurityMonitor's LoginSucceeded event, check for the existence of the dashboard and if it does not exist create it.
You can actually pull the Configuration Log and find create in the content and Origin of User.
the drawback is that this isn't an event, so you will need to run a timer or scheduler to monitor for it.
Not quite sure what the timing has to be for your actions, but otherwise you can capture a User's login fairly easily and then use some property of the user to run certain routines.