Duplicate instance of related action.

Hi All,

We were checking a scenario in which  if I open any related action from a record and again copy the URL of the related action and  launch it in the another Tab of the same browser , it create 2 different instances of the same process model .

Can we have some a way to stop create a duplicate instance of PM  as both are launch in the same browser ?

 

Cheers

 

Manish

 

 

  Discussion posts and replies are publicly visible

  • These are not duplicates and is working as intended since every time you click on a related action the desired behavior is to initiate an action. I don't think you can use the fact that the relation was launched from the same browser to avoid initiating a new process. For defining duplicates you need to have a piece of info e.g. the record ID and if you know it should have no more than one running instance of that related action then you can use a DB flag to hide the related action for a specific record once it has one started. In addition you can also add logic to the beginning of your process to check if there is already an existing process instance for that record ID, if so just terminate the new process without doing anything else follow the normal flow. This should catch the edge cases where the related action is triggered in quick succession or if someone directly paste the URL like you mentioned.
  • Hi Manish,

    is this something that would be an actual issue - users attempting to launch a related action both from the record and a URL?

    Either way, you would probably be able to check after starting the process model whether said record already has an instance open and then close the instance again. Let me know whether you can work with that or need more detail?
  • Hello Manish,

    As mentioned above it is not exactly the same process but it can certainly be the same record which initiated the processes.
    Having a flag or lock and a check at the very beginning of the process can help you to make sure you just have one instance.

    For example:
    Having two users with the record open (without refreshing) it is very likely to happen very often so your question is quite good, but if you write something to the DB when someone clicks on the related action (after submitting the start form) then when the second person clicks on it you check for the flag and kill the process.

    This can still be a problem if two users can click at exactly the same time the same record, which the probabilities are reduced a very very much compared with the previous scenario.

    If your process needs to ensure that the record is just affected once and you don’t have related actions (even if you do there are tricks) you can add the JPA annotation @Version that prevent that 2 persons affect the same record at the same time.

    Jose