Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Choice

A Choice or Decision Element used in UML Activity and StateMachine diagrams as depicted in Sparx Systems Enterprise Architect.

Description

The Choice pseudostate is used to compose complex transitional paths in, for example, a StateMachine diagram, where the outgoing transition path is decided by dynamic, run-time conditions. The run-time conditions are determined by the actions performed by the StateMachine on the path leading to the choice.

This example depicts the Choice element. Upon reaching the Filter pseudostate, a transition fires to the appropriate State based on the run-time value passed to the Filter. Very similar in form to a Junction pseudostate, the Choice pseudostate's distinction is in deciding transition paths at run-time.

Using a Choice element in a StateMachine diagram as depicted in Sparx Systems Enterprise Architect.

Toolbox icon

Choice element

Learn more

OMG UML Specification:

The OMG UML specification (UML Superstructure Specification, v2.1.1, p.538) states:

...choice vertices which, when reached, result in the dynamic evaluation of the guards of the triggers of its outgoing transitions. This realizes a dynamic conditional branch. It enables splitting of transitions into multiple outgoing paths such that the decision on which path to take may be a function of the results of prior actions performed in the same run-to-completion step. If more than one of the guards evaluates to true, an arbitrary one is selected. If none of the guards evaluates to true, then the model is considered ill-formed. (To avoid this, it is recommended to define one outgoing transition with the predefined "else" guard for every choice vertex.) Choice vertices should be distinguished from static branch points that are based on junction points.