Hi all,
I have a question about process variables behavior in parallel flows and exception handling.
Scenario:
- The parent process has a process variable (pv!x) initialized with value = 5.
- The process splits into two parallel branches.
- Both branches start with pv!x = 5.
Then:
- Branch A continues execution, updates pv!x, and reaches the merge point.
- The parent process continues and later updates pv!x = 6.
- Meanwhile, Branch B is still active and waiting in a task (for example, a user input or a task with an exception flow handling an error).
Question:
Will Branch B see the updated value (pv!x = 6) while it is still in that task/exception state, or will it continue working with the original value (pv!x = 5) that was evaluated when the branch started?
In other words:
Are process variables dynamically re-evaluated for already running parallel activities, or do they keep the value from the moment the activity started?
Thanks in advance!
Discussion posts and replies are publicly visible
When the flow reaches the user input task in Branch B, depending on whether pv!x was already updated in Branch A or not the value passed to task node will vary. 1. If pv!x is updated to 6 before user input task started then branch B will pass 6 to the task
2. If pv!x was not updated to 6 and user input task starts in Branch B then 5 will be passed to the task.
3. In both the cases however as soon as branch A updates the pv!x to 6 Branch B will see the updated value as the variable referenced is the common and not a copy or reference.
Overall in terms of value passed to task depends in timing of the flow in parallel. But in process at any point of time or Branch, pv will hold one value only - 5 or 6! Child nodes can have older or newer value depending on the sequence they occur.