How to display a pop up or modal window for user when session time is more than 10 hours?
We have a requirement where user active session time will always be counted and when it crosses 10 hours we need to display a modal window to display some message and asking user to click log off button on the modal window and it will log off.
We need help in this implementation, anyone having any experience or idea please let us know.
***Edited by Moderator: Pallavi to update platform capability tags***
I think you can try below approach which most probably will solve the problem.
1. Create a notification channel from Dev Studio->User Interface->Notification channels. Add some property for user/operator in your class and add that to "properties to publish" in newly created notification channel.
2. For your portal, open the section rule which is added to harness. In the section add a new dynamic layout and add On Load event in Actions tab. For On Load event Subscribe the Notification Channel created in step #1. Provide filter condition also. In this case it will be the property created in our class in step#1 .Operator and value will be OperatorID.pyUserIdentifier which is current login operator id. In the call back you can call a local action to show the message.
3. Create an activity to publish the notification. In this activity, check if any operators are already having active session for 10 hours. I think you can filter Operator ID table by pyLastSignon value. Or you can use your current logic to find if it is more than 10 hours but get operators list having session active for 10 hours.
4. Loop through the list of operators. Add a new page and set .Operator in the newly created page. Use same page as step page and call publish notifications.
5. Call this activity from an Agent and run every minute or 5 minutes based on the requirement.
I just tried this on local setup without agent and without session time logic. I was able to publish to multiple operators and able to get popup for different operators logged in different browsers at same time.
Please see video on implementing and debugging real time notifications below.