Skip to content

Conditional Branching

Johannes Heucher edited this page Oct 12, 2022 · 3 revisions

Conditional Branching can be used to model decisions inside of a Workflow. The Conditional Branching can have several lanes with conditions (cf. fig. 1 (B)) and has at least one default-lane (cf. fig. 1 (D)) without any condition. Depending on the condition ordered from top to bottom, the first matching lane will be executed. The default-lane is always the last lane. Given that the last lane never has any conditions it is guaranteed, that exactly one lane is taken during runtime.

Figure 2: Shared condition parts example Conditions can have shared parts (cf. fig. 2). This shared part is a condition on top of the branching underneath the diamond shape (cf. fig. 1 (A)). The ?-symbol is used as wildcard and stands for the particular condition on the lanes beneath. The condition modeling is done with the techniques of Formula Modeling.

To insert a Conditional Branching, drag the Conditional Branching symbol from the icon bar into the Workflow.

New lanes can be added via the plus icon (cf. fig. 1 (E)). To edit the condition of a new lane, click on condition area inside the new lane. To define the process behind one condition, toggle the minimize/maximize symbol beside the condition. The opened area can be used to model the steps that will be taken, if the condition is met during runtime.

Table of Contents

Combine Conditions

A condition can be combined with another one by dragging it onto the other condition. The lane will be executed if any of its conditions match.

If the lanes of the combined conditions aren't empty, a dialog with several options to combine the lanes will show up.

Separate Conditions

If a lane has more than one condition, you can separate them by dragging one of the conditions to another matching place inside of the Conditional Branching.

Delete Conditions

To remove a lane with a single condition, select its label and press <kbd>Del</kbd>. If a lane has more than one condition all of them will be deleted.

Modeling the Condition

The condition is modeled with the Formula Modeling and must evaluate to true or false. The condition's formula is evaluated at runtime based on the information contained in the used parameters.

To edit the condition, click on the question mark. For modeling condition terms, see Formula Modeling.

Modeling the Output Parameters

Conditional Branching detects the possible Output Parameters (marked in fig. 1 (F)) automatically, if the decision is unambiguous. So if there is an Output Parameter of a specific Data Type created on every lane, this parameter will be used as Output Parameter on the Conditional Branching automatically.

Figure 3: Assuming a condition Other Output Parameters can be added by dragging them into the diamond shape at the bottom of the Conditional Branching. It has to be guaranteed that in each lane the Output Parameter is assigned. If the assignment is unambiguous, it will be done automatically. If the lane terminates with a Throw, the outputs are not relevant on this lane. If there is no or more than one possible source for the assignment, the user has to take a decision for each of such a particular lane. Therefore the lane has to be selected by clicking on one of its conditions. The whole lane will be highlighted to indicate the selection (cf. fig. 3). Now the output can be assigned by modeling a constant value or solving an ambiguity.

Please note: For setting constant values, see Setting Constants. For solving ambiguities, see Solving Ambiguities.

See Also

Clone this wiki locally