Flow Merging
Another key feature of 'Smow' is the ability to merge flows. We can merge different flows or branches into a single flow.
Merging flow
Lets understand how merging works in Smow. The flow starts with an 'event' node node 1
. This 'event' node triggers an event to the next node, node 2
which is an activity node. The flow is branched at node 2
. The node 3
and node 5
forms a branch while node 4
and node 6
forms another branch. The two branches get executed independently.
We can see that the flows get merged at node7
. The nodes node 5
and node 6
merge together to node 7
. Now, node 7
is connected to node 5
as well as node 6
. Among the two, whichever node finishes it's activity sends an input signal to node 7
and it starts performing it's activity and sends an input signal to the next connected node which is the node 8
. After that, the other node which finishes it's activity later, sends an input signal to node 7
and the node 7
again performs its activity. Thus the flow from node 7
onwards, runs twice. This is how merging flows work in Smow.