I am working on a related action and while working on a related action I don't want anyone to work on that related action

Certified Senior Developer

I am working on a related action and while working on a related action I don't want anyone to work on that related action so how to implement this scenario?

  Discussion posts and replies are publicly visible

  • How I have implemented this feature is using this plugin -  Text Cache. It allows you to store a value in the server's cache memory. So here is what you need to do

    1. Identify the name of the key you want to create Rg. AddUserRelatedAction.
    2. Now using the above plugin, set your username (loggedInUser) in this key using the plugin in a local variable as the screen loads. 
    3. Now check if the local variable has a value, then show the contents of the screen otherwise keep it hidden. 
    4. When the user submits the form, set the key back to null. 

    This way, when the key has a value, someone is using it. If it doesn't have a value, no one is using it. 

    Hope it helps!

  • 0
    Certified Senior Developer

    You can try assigning the particular case to yourself like assignee with your name and the related actions should be visible only when assignee is the same as the loggedinuser.

    But the case should be assigned to your name in some prior step.

  • 0
    Certified Lead Developer

    I'm implemented this before using a low-complexity DB table and a pessimistic locking system - any time the related action is kicked off, the table can be queried and returns a row with the result of the status of the process; if another user is marked as having an active instance, the current user is routed to a different task that simply tells them it's in use.  Otherwise they're instantly routed to the normal task, while at the same time a DB row is written indicating that they have an instance open.  When they complete or cancel, that row is updated indicating that their instance is no longer open.  One advantage here is you can scale this up to handle different process models just by making one of the columns in the table based on the PM ID.

  • 0
    Certified Lead Developer
    in reply to Harshit Bumb (Appyzie)

    FYI - don't use that text cache plugin in an HA environment.

    Honestly, no clean way to do this. Mike's approach also has some caveats, people need to complete or cancel. Though, you could implement something like Appian does for process models by notifying the user that someone has taken the task and give them the option to kick them out. 

  • 0
    Certified Lead Developer
    in reply to Mathieu Drouin

    definitely - and/or you need to implement a strict (and probably relatively cruel) task timer - at least for actions with a high possibility of this sort of collision.

    people need to complete or cancel.