Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Service Development | Failure Handling in Flow Services Using the TRY, CATCH, and FINALLY Steps | Limitations for the TRY, CATCH, and FINALLY Steps | EXIT Step Considerations in TRY, CATCH, or FINALLY
 
EXIT Step Considerations in TRY, CATCH, or FINALLY
In addition to exceptions thrown by services, a flow service can create an exception using the EXIT step. In the EXIT step, you can specify the name of the exception to create and a failure message. These failures can be caught by a CATCH step or can be propagated to parent services which may provide failure handling logic.
Keep the following information in mind when using an EXIT step within a TRY, CATCH, or FINALLY step.
*An EXIT step that is an immediate child step of a TRY, CATCH, or FINALLY step can be configured to signal failure when exiting from a $parent or $flow only. If the EXIT step is configured to signal failure and exit from a $loop, $iteration, or label, at run time Integration Server throws a FlowException and terminates the flow service immediately. Integration Server does not execute any CATCH or FINALLY blocks prior to terminating the flow service.
*TRY, CATCH, and FINALLY steps may only be targets of an EXIT step that signals success.
*An EXIT step nested more deeply within the TRY, CATCH and FINALLY steps may signal failure and exit from any destination (such as $loop, $iteration, label, $parent) as long as the destination is also within the body of the TRY, CATCH, or FINALLY step.
*Exit from $flow with failure is immediate and Integration Server does not execute any intervening CATCH or FINALLY steps.
*An EXIT step configured to exit $parent and signal failure can be used to override the current pending failure with another failure.
*An EXIT step configured to exit an $iteration and signal success might be useful in a FINALLY step that is contained within A LOOP or REPEAT because it ensures that the FINALLY step executes before the next iteration runs.
For detailed information about how abrupt completion and failure affect a TRY, CATCH, or FINALLY step at run time, see Normal and Abrupt Completion and Failure of TRY, CATCH, and FINALLY Steps.
For general information about creating an EXIT step, see The EXIT Step.