Several control flow tasks (i.e. a Business Process task composed of several other tasks) are available that provide easier data looping and conditional constructs. The BP editor has also changed to reflect this structured flow.
The following new types can be used as parameters and variables in the Business Process editor.
- Dictionary: A collection containing key-value pairs.
- Tasks include: Create, Get, Has Key, Keys, Values, Put, Remove, and Size.
- List: A collection containing an ordered list of objects.
- Tasks include: Create, Get, Add, Remove, Last, and Size.
- JSON: Data that is structured in the JSON format.
- Tasks include: Read from Create, Type, Get, Set, To Dictionary, To List, and To StorageNode.
New tasks include:
For each: For each item in a list, a specified task is executed.
Do while: Executes a task while a specified condition is true. The specified task is executed before the condition is checked. This means that the specified task is always executed at least one time. Then the condition is checked. If the condition is true, then it executes again (then the condition is checked again). And so on.
While do: While a specified condition is true, a specified task is executed. The condition is initially checked before the given task is executed. This means that the condition is checked first before the task is performed. So, if the condition isn't immediately true, then the task is never executed.
If/Then/Else: (Shown here) If a given condition is true, a specified task will be executed in the “then” block. If the given condition is false, the specified task will be executed in the “else” block. In the example below, different Business Processes will execute based on the result of the initial “If” statement.
Using Pass/Fail Parameters with Control Flow tasks
Task labels and pass/fail parameters can still be still used to control the sequence of logic in a Business Process. While task labels and pass/fail parameters can be used at the control flow task level (If/Then/Else, for example) they cannot be used by the sub-tasks contained within control flow tasks themselves.
Force Step Failure task (typically used with If/Then/Else)
The Force Step Failure task can be used to force the entire step that it is contained within a control flow task to fail. When using control flow tasks, if a singular task does not complete successfully, the overall control flow task (If/Then/Else, for example) does not necessarily stop nor appear as failed in the Auditor. By using the Force Step Failure task, an optional error message can be provided when the task is executed (thereby providing better troubleshooting).
For example, in the Business Process below the Force Step Failure task has been included within a While Do task. If the ReadLocationsFA (File Adapter) task fails, then the entire step fails, and an error message can be made to appear in the Auditor.
Additional information on these Business Process enhancements can be found in the Designing Integration Solutions | Processing the Data | Business Processes section the Online User Guide or In-Product Help.