Sequence Flow and Process Definitions
Introduction
The sequence flow of a Process Definition can be determined by conditional logic that directs the end-user to different activities during an ID&V flow.
This guide will discuss how to set the sequence flow and default flow in cases where conditional logic is used to alternate the flow of a Process Definition. Defining the sequence flow can be useful in configuring various use cases such as:
Configuring Sequence Flows
The example in this document will demonstrate how sequence flows and conditional logic can be used to change the flow of a process based on whether the end-user has started the process from a desktop or mobile device.
Using the sample Process Definition below, steps will be added to switch the end-user to a mobile device if they started the flow from a desktop.

Step One - Add Entry Gateway
To begin, create a new gateway using the left-side activity pallet. This gateway will be used to branch the flow in two directions depending on the outcome of a conditional expression.

When the gateway is added, click the gateway to open the right-side contextual menu and set the 'Name' parameter to "Is user mobile?"
Finally, connect the gateway to the Introduction activity using a sequence flow arrow.
Step Two - Create Switch to Mobile Flow
If the end-user has started the flow using a desktop, the 'Switch to Mobile' activity can be used to start the process of changing their device.
Add the 'Switch to Mobile' activity to the Process Designer and connect the activity to the recently created gateway and the 'Consent approval' gateway.

Step Three - Create Already on Mobile Flow
If the end-user is already using a mobile device, there is no need to switch the current device. In this case, the flow will move directly to the consent approval gateway without requiring further action. For this, a new sequence flow arrow will be created that connects the 'Is user mobile' gateway to the 'Consent approval' gateway.

However, this causes an issue as the Process Definition has no way of determining which flow to follow by default. Additionally, there is no way of accessing this new sequence flow when the user is already on a mobile device.
To resolve this, first click on the newly added sequence flow arrow to open the right-side contextual menu.
Under the 'Condition' parameter, add a new condition of type 'Expression'. Input the following value:
${execution.hasVariable("isMobile") ? isMobile : false}
This expression will check to see if the end-user is currently using a mobile device. If they are, then they will proceed with this flow of the Process Definition.

Step Four - Set the Default Flow
Now that both sequence flows have been considered and conditional logic has been implemented to differentiate them, a default flow will be set. In this instance, the default flow will be the 'Switch to Mobile' flow.
Click the sequence flow arrow that connects the gateway to the 'Switch to Mobile' activity. Next to the arrow, a 'Change Type' spanner icon will appear. Clicking this option will open up the list of configurations. In this instance, click the 'Default Flow' option.

When successfully implemented, the sequence flow arrow will be updated to include a dash. This signifies that the sequence flow arrow is the default flow.
