Adding branching logic in processes
With branching logic in processes, you can control the execution flow of activities for a process. Branching logic is available for all processes.
Use branching logic when a process needs to:
- Take different paths through its activities
Attempt auto-recovery from a failure
For example, you might use this if you need to start a server process, and the start mechanism is nonblocking in such a manner that you need to regularly test the server state until it has initiated correctly or fails after a number of attempts.
To add a new failure branch to an existing process
- Click the Define tab.
- From the left menu, select Processes.
- Locate and click the process to which you want to add branching logic.
Click the Activities tab where you want to add a failure dependency.
- For the channel/environment process, click New Activity.
- For the content process, click the appropriate tab for the desired activity, and then click New Activity.
- Provide a name for the activity to initiate the failure branch.
- Identify the library to use to initiate the failure branch.
- Select Failure as the dependency type, and select the dependent activity from the list.
- Click Create for a new activity, or click the Submit icon to save changes to an existing activity.
- For each task in the Tasks section, view and modify the task settings in the Configure tab.
- Click Save, and then click Done.
After a failure branch has been initiated, the flow inside the branch follows the standard dependency order. Activities can depend on the success or failure of activities within the failure branch, enabling you to create complex branching logic. In the console, the failure branch from a top-level activity is visually indented to show that it is a separate path from the successful execution flow through the process.
Failure branch activities
The following activity libraries are designed specifically for failure branch logic:
Activity library | Description |
---|---|
Sleep | Inserts a pause in the execution of the branch logic. You indicate the length of the pause by using the library configuration parameter. The ideal use for this library is to identify how long to wait before restarting a failed activity. |
Restart Last Failed Activity | Reinitializes the previously failed activity (in its processing branch) and all the activities that have occurred along the path between the two activities. Use the library configuration parameter to specify how many times to attempt to restart the failed activity. After reaching the limit of times, the failed activity is not restarted and the process fails. |