Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Service Development | Building Flow Services | The BRANCH Step | Using a SEQUENCE as the Target of a BRANCH
 
Using a SEQUENCE as the Target of a BRANCH
In many cases, you may want a BRANCH step to conditionally execute a series of multiple steps rather than just a single step. For these cases, you can use the SEQUENCE step as the target step and group a series of flow steps beneath it.
The following example illustrates a service that accepts a purchase order and processes it one of three ways depending on the payment type specified in the PaymentType variable. Because a series of steps are needed to process the PO in each case, the targets of the BRANCH are defined as SEQUENCE steps, and the appropriate series of steps are specified as children beneath each SEQUENCE.
Use a SEQUENCE step as the target for a multi-step alternative
Define a multi-step alternative in a SEQUENCE
The SEQUENCE step that you use as a target for a BRANCH can contain any valid flow step, including additional BRANCH steps. For additional information about building a SEQUENCE, see The SEQUENCE Step.
Note:
TRY, CATCH, and FINALLY steps cannot be the direct child of a BRANCH step. To use TRY, CATCH, and/or FINALLY steps within a BRANCH step, wrap the steps with a SEQUENCE, REPEAT, or LOOP step.