Illegal Merge of Concurrent Flows

The activity diagram contains a forbidden construction, namely several concurrent flows are merged.

This type of construction involves a merge node or a connector merge. This node forwards every incoming flow to its sole outgoing edge. When two or more concurrent flows are merged, the outgoing edge is visited by several tokens in one activity step and, thus, an error. Usually, in the activity step you will find a fork node, the source of parallel flows, or several initial nodes



An example of this type of error is depicted in the following figure.

As shown with highlighted yellow background, the activity step from timer t0 contains a fork node which introduces two concurrent flows. These flows are merged before entering operation opC.

Possible Solution(s)

Depending on the behavior of your application, there are several possible solutions. For the example above, two alternative constructions as shown in the following figure remove the error.

  • in 1, the two flows are serialized.
  • in 2, a 0ms timer is added to the right hand-side flow.

Note that those two new constructions behave differently.

  • In 1, the sequence of method calls is opA –> opB –> opC. Here, opC is executed only once.
  • In 2, the sequence of method calls is opA –> opC –> opB –> opC. Here, opC is executed twice.