Search code examples
mergeumlbranchactivity-diagram

Why do Branch and Merge use the same symbol in UML Activity diagrams?


What is the rationale behind Branch and Merge using the same symbol?

example of Branch and Merge in UML Activity diagram, both using diamonds

I find it confusing, because you can't rely on the shape to know whether there's a conditional going on or not.

Is there some other standard symbol or symbol variation I can use? I would rather avoid connecting many arrows to the same endpoint, because it makes it difficult to follow the diagram. But I'd also like to differentiate between conditionals and merge points.

Note that this question has nothing to do with Fork and Join, which deal with concurrency and are represented by a black rectangle.


Solution

  • The reason probably is that you are allowed to combine the two in a single node.

    UML 2.5 specs state:

    The functionality of a MergeNode and a DecisionNode can be combined by using the same node symbol, as shown in Figure 15.34. At most one of the incoming flows may be annotated as a decisionInputFlow. This notation maps to a model containing a MergeNode with all the incoming edges shown in the diagram and one outgoing edge to a DecisionNode that has all the outgoing edges shown in the diagram.

    enter image description here