Previous UML Classes Table of Contents UML Packages Next


12.3.36 MergeNode

IntermediateActivities


   A merge node is a control node that brings together multiple alternate flows. It is not used to synchronize concurrent flows but to accept one among several alternate flows.

*Generalizations

   ControlNode (from BasicActivities ) on page 371

*Description

   A merge node has multiple incoming edges and a single outgoing edge.

*Attributes

   No additional attributes

*Associations

   No additional associations

*Constraints

   [1] A merge node has one outgoing edge.

   [2] The edges coming into and out of a merge node must be either all object flows or all control flows.

*Semantics

   All tokens offered on incoming edges are offered to the outgoing edge. There is no synchronization of flows or joining of tokens.

*Notation

   The notation for a merge node is a diamond-shaped symbol, as illustrated on the left side of the figure below. In usage, however, the merge node must have two or more edges entering it and a single activity edge leaving it. The functionality of merge node and decision node can be combined by using the same node symbol, as illustrated at the right side of the figure below. This case maps to a model containing a merge node with all the incoming edges shown in the diagram and one outgoing edge to a decision node that has all the outgoing edges shown in the diagram. It assumes the UML 2.0 Diagram Interchange specification supports the interchange of diagram elements and their mapping to model elements.

Figure 12.105 - Merge node notation

*Examples

   In the example below, either one or both of the behaviors, Buy Item or Make Item could have been invoked. As each completes, control is passed to Ship Item. That is, if only one of Buy Item or Make Item completes, then Ship Item is invoked only once; if both complete, Ship Item is invoked twice.


   Figure 12.106 - Merge node example

   Merge nodes are introduced to support bringing multiple flows together in activities. For example, if a decision is used after a fork, the two flows coming out of the decision need to be merged into one before going to a join. Otherwise the join will wait for both flows, only one of which will arrive.

*Changes from previous UML

   Merge nodes replace the use of PseudoState with junction kind in UML 1.5 activity modeling.