When a node in a process is configured to run multiple instances (or if a process flow loops back on itself) each copy of the node calls and/or writes to the same process variables (PVs). In such cases, it is possible to have one instance of a flow overwrite the value in another. To avoid this problem, shield the value passed between each node (in a multi-instance flow) using the Keep process variables synchronized option on the Flow Properties dialog box, which is configured by double-clicking the flow connector on your process model.
When the Keep process variables synchronized option is selected, all PV values used in the output phase of a node are protected from overwrites – from the start of the flow – to the start of the next node. For example, if three instances of a node are spawned (and the node is configured to continue the flow after each instance completes) the PVs in outgoing flows are protected from being overwritten by each other.
The overwrite-protection is distinct for each instance, but it does not place a lock on the process variable (meaning that other flows can still write to the PV if you have another using the same variables). This feature also triggers an update to the PV prior to following the flow.
All PVs used during the output phase of a node are shielded from overwrites, when this option is enabled. These include PVs used by expressions in Rules, Timers, and other event conditions.
Double click a Connector between two nodes of the process model. The Flow Properties dialog box is displayed.
Select the Keep process variables synchronized across this flow checkbox.
When the Keep process variables synchronized option is selected, if a PV is used in the Output phase of node execution, it is also protected from overwrites across any subsequently shielded flows. The following nodes frequently consume PVs during the Output phase.
Rule Event: When a protected flow arrives at a Rule Event node, the Rule Conditions are evaluated immediately. If the Rule Event is false (and does not execute) the protected PV value is discarded.
Timer Event: A Timer Event might be triggered during Output; however, if a Timer Event condition is false (and does not execute) the protected PV value is discarded. A true timer event PV that is consumed during the Output phase will be shielded from overwrites.
Gateways: When a protected flow arrives at a gateway, the expressions configured for the node are evaluated immediately. The protected PV value is also retained and made available to any subsequent flows.
Nodes with multiple incoming flows: When processes include gateways with multiple incoming flows with only one outgoing flow, only the PV values carried by a winning incoming flow are passed on to the subsequent node.
Scheduled Nodes: When a protected flow arrives at scheduled node, the protected value is stored until the node executes.
Receive Message Events: Regardless of the configuration setting, PVs will always synchronize across flows on the output flow for a Receive Message Event node.
Protected PV values also keep their shielding when associated with a reassigned task. Any subsequent assignees are supplied the same data as the initial assignee.
As the synchronized option only applies to process flows, you might need to write the value from one shielded flow to a Node Input, then to a Node Output, then to the next flow. This would ensure that the PV value cannot be overwritten during node execution.
If you need to shield more than one flow, we recommend that you put the related nodes into a sub-process.
During the Output phase, a PV's value is written from the Node Output at the same time it is passed to the outgoing flow. You can further shield the PV value in other flows by creating a new PV from the existing value. See also: Process Variables and Parallel Flows.
To shield a process variable's value through the Start, Run, and Output phases of a node's execution:
Type an expression in the Value field, using the following syntax.
Save the node input data to a custom node output on the Data tab.
The outgoing flow(s) must be shielded, until the flow no longer executes with multiple instances. Right-click the outgoing flow. Select the Keep process variables synchronized option.
On This Page