Skip to main content
1-Visitor
April 22, 2021
Solved

How to trigger a custom event every time a user accesses ThingWorx

  • April 22, 2021
  • 3 replies
  • 3297 views

Hi Team,

 

Hope everyone is doing well.

 

I would like to know how will I throw my custom event each time a user logs in and logs off ThingWorx.

 

Thanks in Advance.

Best answer by SrijithKrish

Hi @slangley 

 

Thank you for the response. The current implementation uses a scheduler that monitors the number of users logged in and compares with the users before in a particular interval. This implementation is working currently.

 

Thank You @BABA-SHYAM those events are very useful I had tried them but the problem was during logging out, there will be users who might not log off in the required manner.

3 replies

Community Manager
April 22, 2021

Hi @SrijithKrish.

 

Are you referring to a user logging in to Composer or a mashup?  If you're referring to a mashup, you could design a service to run each time the user logs in.  Logging out would be more difficult since it requires a user to logout elegantly instead of just closing the browser.

 

Regards.

 

--Sharon

1-Visitor
April 23, 2021

@slangley , main requirement is to keep track of all the users that are accessing Thingworx within a day (both via composer as well as mashup application), that is I would require to keep history of this data. Currently I am able to see how many people are using but not the history.

Is this requirement possible within ThingWorx?

15-Moonstone
April 29, 2021

Hi,

 

There is a security monitor thing (don't select template with same name) available in thingworx. There you will find a "LoginSucceeded" event under it. This event will work if your user is login by typing the credentials. There is another event available "ApplicationKeySucceeded " if user try to access thingworx using app key. Every time this event occur you can run a custom event.

 

Regards

Shyam

Community Manager
May 10, 2021

Hi @SrijithKrish.

 

Have you found a solution to your issue?  If so, we would be happy for you to post it here for the benefit of others in the community.

 

Regards.

 

--Sharon

SrijithKrish1-VisitorAuthorAnswer
1-Visitor
June 1, 2021

Hi @slangley 

 

Thank you for the response. The current implementation uses a scheduler that monitors the number of users logged in and compares with the users before in a particular interval. This implementation is working currently.

 

Thank You @BABA-SHYAM those events are very useful I had tried them but the problem was during logging out, there will be users who might not log off in the required manner.

15-Moonstone
June 2, 2021

Hi,

 

What is the role of those users? I don't think any such issue could happen while logging out the user. User logs out successfully right? Its only the trigger which doesn't run. Is it happen always? Did you try to debug the issue?

 

Regards

Shyam