BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

Instance migration - Parallel paths

By Mohamed Said posted Wed February 21, 2024 08:20 AM

  

In the previous blogs I shared couple of thoughts around development patterns for changing the flow of a process by adding new tasks and moving the location of the current tasks. 

In this blog, it is more around parallel paths inside the process and how to consider the previous process. My aim is always to try and migrate the instance to the latest snapshot and avoid having a trail of snapshots hanging in the system. 

I know this might be considered trivial but in a typical system where no instance migration is considered and one snapshot after another being deployed, it is easy to find 800 snapshots deployed. This has a significant impact on the process execution. As the system become more and more critical, keeping it effective and efficient is key.

In the scenario of this blog, the idea is to cover the example in the flow below

It is normal as the process evolve to get a request to add a new path in the parallel path. The join condition requires that all paths to be completed to move into the 'Third Task'. 

The challenge with that is the old snapshot in production has 2 parallel paths while the new process will have 3 parallel tasks. At that point, if we migrate the instances, then the expected behavior of the engine will cause the old process instances to stall as there is no token on the third path as it didn't exist in the old snapshot.

The idea is that at development time, change the 'join' to an 'inclusive gateway'. In the inclusive gateway, you will need to write a set of conditions that would check if there is a task in the 'Third Path' or not and whether this is a migrated snapshot or not.

A common way that I use, is that I have an internal variable that I populate with the snapshot ID at the beginning of the process only. In the inclusive gateway, I check that snapshot ID against the current snapshot ID that is active, if they are different then this is a migrated instance and I won't wait for the new path to finish. This is one of possible way, but you would consider the condition that is more appropriate to your case.

0 comments
16 views

Permalink