Control flow (UML)
A control flow (engl. Control Flow ) is a model element in the Unified Modeling Language (UML), a language for the modeling of the structures and the behavior of software - and other systems.
A control flow is a special activity edge in an activity . It connects actions and control nodes . In contrast to an object flow, only control tokens can flow over a control flow. A control token can be thought of as a kind of token that can transfer an action to another action in order to trigger it. Control tokens do not transport any further values. With the help of a control token, an action cannot transfer output values to a neighboring action to which it is connected via a control flow.
Not every control flow modeled between two actions can transfer control tokens at any time. A modeler can manage the "conductivity" of a control flow in two ways. Firstly, he can provide the control flow with a so-called guard , a Boolean expression that is evaluated whenever the producing action offers the control flow a control token. The control token can only flow if this expression evaluates to true. Second, the control flow with a weight (engl. Weight ) are provided. Weight is a positive number. It specifies the minimum number of control tokens that must be offered by the producing action before all available tokens flow together across the control flow. The weight is therefore a modeling parameter that defines a kind of “package size” for control flows.
notation
A control flow is shown as a solid line with an open arrowhead. This notation corresponds to the notation for the object flow . A control flow can usually be easily distinguished from an object flow because it is never connected to an object node , for example a pin , at one of the two ends.
The figure on the left shows a control flow that is also parameterized with a guard (in square brackets) and a weight (in curly brackets). The two parameters specify that tokens can only flow over the control flow if it is not a lunch break and if at least two requests have been formulated.