Skip to main content

Sequence Flow

Introduction

Sequence Flow

info

A Sequence Flow is used to show the order of Flow Elements in a Process or a Choreography. Each Sequence Flow has only one source and only one target. The source and target MUST be from the set of the following Flow Elements: Events (Start, Intermediate, and End), Activities (Task and Sub-Process; for Processes), Choreography Activities (Choreography Task and Sub-Choreography; for Choreographies), and Gateways.

— BPMN 2.0.2 Standard, 8.4.13, Sequence Flow

There are a number of ways to connect elements in BPMN. However, by far the most common one within executable business processes is the Sequence Flow.

A sequence flow is the connector between two elements of a process. After an element is visited during process execution, all outgoing sequence flows are followed. This means that the default nature of BPMN 2.0 is to be parallel: two outgoing sequence flows create two separate, parallel paths of execution.

A sequence flow can have a condition defined on it. When a BPMN 2.0 activity is left, the default behavior is to evaluate the conditions on the outgoing sequence flow. When a condition evaluates to true, that outgoing sequence flow is selected. When multiple sequence flow are selected that way, multiple executions are generated and the process is continued in a parallel way.

note

The above holds for BPMN 2.0 activities (and events), but not for gateways. Gateways handle sequence flow with conditions in specific ways, depending on the gateway type.

A condition defined on a gateway must be an expression and must always evaluate either to the boolean value true or false.

All BPMN 2.0 tasks and gateways can have a default sequence flow. This sequence flow is only selected as the outgoing sequence flow for that activity if and only if none of the other sequence flow could be selected. Conditions on a default sequence flow are always ignored.

tip

It's a modeling best practice that the only elements with more than one incoming or outgoing sequence flows are gateways. All other elements typically have one incoming and one outgoing sequence flow. The only exception to this rule are events, which often have also no incoming or no outgoing sequence flow.

Properties

General

AttributeTypeDescriptionCategory
Model Id Text

Model Id identifies the element within the process model.

The model id, name and documentation properties can be found on any element. They are used respectively to uniquely identity the sequence flow, to give it a user-friendly name and to add a free-form description.

If a name is set on a sequence flow, it will be shown in the diagram and it can be moved around freely.

Name Expression usage possibleText

The name of the element. This is the name displayed in the diagram.

Documentation Multiline Text

A free-form text that can be used to explain details about the particular element.

Condition expression Expression usage possibleText

If a sequence flow is used after a gateway, you can use this condition to specify which of the paths to follow. In other cases, any sequenceflow which has a condition that evaluates to true will be followed, potentially concurrent. Use any expression which must evaluate to true or false in order for the engine to decide which flow to follow. Some examples: '${root.needApproval}' or '${nextStep == 'approved'}'. Conditions are ignored for sequence flow after a parallel gateway.

A sequence flow can have an expression as condition, which is evaluated when the process instance execution takes the sequence flow. Depending on the source element, the sequence flow will not be taken when the condition evaluates to true.

The 'default flow' checkbox will be used to select a sequence flow when none of the conditions on the outgoing sequence flow of the source element evaluated to true. There can be only one such sequence flow for a given source element and it gets a visual marker in the BPMN model.

Skip expression Expression usage possibleText

If the Skip expression evaluates to true, the flow is taken regardless of any condition.

It is required to opt-in to this feature by setting a variable _FLOWABLE_SKIP_EXPRESSION_ENABLED with the Boolean value true on the process instance.

Default flow Boolean

Define the sequence flow as default.

Advanced

AttributeTypeDescriptionCategory
Execution listeners List

Allows invoking custom after certain lifecycle events.

Start: Executes after the activity has been started.

End: Executes after the activity was completed.

Transition: When defined on a sequence flow, executes once the flow is transition is taken.

Execution listeners are used to add logic on certain lifecycle events.

Typically it is used to add extra technical logic which shouldn't be visible in the BPMN process model.

Visual

AttributeTypeDescriptionCategory
Font size Selection:
  • 8
  • 9
  • 10
  • 11
  • 12
  • 14
  • 18
  • 20
  • 24
  • 36
  • 48
  • 72

Font size.

Visual properties that determine how the sequenceflow is shown in the diagram.

This has no impact on the runtime execution.

Font weight Selection:
  • Normal
  • Bold

Select the style between bold and normal.

Font style Selection:
  • Normal
  • Italic

Select the style between italic and normal.

Font color Color

Select a font color.

Background color Color

The background color of the element in the diagram.

Border color RequiredColor

The border color of the element in the diagram.

List Attribute Details

Execution listeners

AttributeTypeDescription
Event RequiredSelection:
  • Start
  • End
  • Take

The lifecycle event. The 'Take' event is only available for sequence flow.

Class Text

Fully qualified classname of a class to be invoked when executing the task. The class must implement either JavaDelegate or ActivityBehavior.

Expression Text

JUEL Expression to be executed when the task is started. Expressions allow you to interact with the backend by calling services, making calculations etc. You can find more information about expressions in the documentation.

Delegate expression Text

Delegate Expression to be executed when the task is started. A delegate expression must resolve to a Java object, for instance a Spring bean. The object's class must implement either JavaDelegate or ActivityBehavior.

Fields List

Fields

AttributeTypeDescription
Name Text

The name of the element. This is the name displayed in the diagram.

String value Text
Expression Text

JUEL Expression to be executed when the task is started. Expressions allow you to interact with the backend by calling services, making calculations etc. You can find more information about expressions in the documentation.

String Text