Check if user is on a page
Application Type
Traditional Web
Service Studio Version
11.10.15 (Build 39829)
Platform Version
11.11.2 (Build 28544)

Hi all,

Can someone help me with a little problem. I have a container on a page with an expression.

I want to show the container with the expression on the page when 2 users (or more) are working on the page.

So for example:
User A is working on page 1 -> Show container with expression "user B is working on the page"
User B is working on page 1 -> Show container with expression "user A is working on the page"

If there is only one user on the page the container should not be displayed.

I can't figure out how I have to do this so can someone help me with this?

Thanks in advance



The Display property defines if it is displayed or not.

Use an expression related to the content to check if it's empty or not

Thanks but that is not what i mean. 

I want to check if there are different users on the same page. If that is true I want to dislay the container with the expression:
User A see:
"Warning user b is also working on this page"

User B see:
"Warning user ais also working on this page"


Hi,

The only way to do that is to have an entity with the users present on the page, basically when the page preparation runs a record is created in the entity and you just need to check if the count is more than 1.

Remember you need to be aware of if the user enters any other page the previously created record needs to be deleted and if the record was created more than 'X' minutes ago the systems needs to clear it, possibly the user closed the browser without going to another page.

If you agree with that approach I can create a simple demo for you.

Hope it helps.

Ricardo Pisco.


That sounds like a good option to me. 

Hi,
That sounds a good option but make sure to handle the below use case while u address under the same approach :
-Consider User-A access the page & system persist the log & now User-A keep the page idle for a while & session get a timeout.

- You need to makesure that the data/log persist gets clear while the userlogout or his session is timeout.
- Again 1 more usecase : How this can be address when the sameuser login from multiple system.

Hi, friend!

I'm pretty sure that you can check these access through systems entities, maybe checking log tables or session tables.

I think it's a good point to start.

Hi,

Please follow below steps to do so.

Step 1: Create a structure with attribute of "Name" to hold the user name.

Step 2: Create local variable in screen of "List of structure" type.

Step 3: Add attribute in your entity as "TaskAssignedTo" to store the user name and task id attribute. And when any task is open by any user then update the value into this attribute.

Step 4: In your preparation call aggregate and place a join between you main entity(task entity) and new entity as mention in above step.

Step 5: After fetching the result assign value to structure 

Step 6: User structure attribute in your expression. 


Hope this will help you

Regards,

Vipasha

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.