Notable Behavior for Abrupt Completion in TRY, CATCH, and FINALLY Steps
Abrupt completion of a TRY, CATCH, or FINALLY can be accomplished with an EXIT step configured to exit from a label, $flow, $loop, $parent, or $iteration and signal success. While the general flow service behavior for abrupt completion in TRY, CATCH, and FINALLY steps is discussed in
The CATCH Step, particular flow constructions merit more detailed explanation.
Exiting from within a TRY, CATCH, FINALLY
When exiting with success from a TRY, CATCH, or FINALLY to a higher level in the flow or exiting the flow service entirely, Integration Server exits all intervening FINALLY steps.
In the following flow service, after Integration Server executes the EXIT step configured to exit $loop and signal success, Integration Server first executes the FINALLY step and then exits the LOOP.
In the following flow service, when Integration Server executes the EXIT step configured to exit from the outer TRY and signal success, Integration Server executes the inner FINALLY, middle FINALLY, and outer FINALLY steps.
Exiting a LOOP Iteration from within a TRY, CATCH, FINALLY
In a TRY, CATCH, or FINALLY step contained within a LOOP step, execution of an EXIT step configured to exit from an $iteration and signal success causes an abrupt completion of that step and any intervening steps up to the containing LOOP step. An abrupt completion of a FINALLY step with an uncaught failure results in the failure being discarded.
In the following flow service, when Integration Server executes the EXIT ‘$iteration’ step contained within the CATCH step, Integration Server executes the FINALLY step before exiting from the LOOP and proceeding with the next iteration over the input array.
Exiting a REPEAT Iteration from within a TRY, CATCH, or FINALLY
In a REPEAT step, execution of an EXIT step from within a TRY, CATCH, or FINALLY step where the EXIT step is configured to exit from an $iteration, causes an abrupt completion of the containing TRY, CATCH, or FINALLY step and any intervening steps up to the containing REPEAT step. An abrupt completion of a FINALLY step with an uncaught failure results in the failure being discarded.
For a REPEAT step configured to repeat on failure, an abrupt completion of a FINALLY step results in the iteration being treated as a success and completes the REPEAT step. Integration Server will not execute another iteration of the REPEAT step. Instead, Integration Server proceeds with the execution of the next step in flow service, if one exists.
In the following flow service, the REPEAT step is configured to repeat on failure. When Integration Server executes the EXIT ‘$iteration’ step contained in the FINALLY step, Integration Server treats the iteration as a success. This causes the REPEAT step to complete.
Exiting a $flow and Signaling Failure from within a TRY, CATCH, or FINALLY
Execution of an EXIT step that exits from a $flow and signals failure results in the immediate exit of the flow service at which point Integration Server throws an exception. Integration Server does not execute any intervening CATCH or FINALLY steps.
In the following flow service, when Integration Server executes the EXIT step inside the inner TRY, Integration Server creates a FlowException. Integration Server then exits the entire flow service. Integration Server does not execute any CATCH or FINALLY steps for the inner try-catch-finally or the outer try-catch-finally.