Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Service Development Help | Failure Handling in Flow Services Using the TRY, CATCH, and FINALLY Steps | About Failure Handling in Flow Services
 
About Failure Handling in Flow Services
 
What Happens When a Failure Occurs?
Failures can occur in a flow service when an invoked service throws an exception, an EXIT operation executes and signals failure, or the flow engine throws an exception because of a flow definition error. The flow language includes facilities that you can use to handle these failures.
Beginning with Integration Server and Designer version 10.3, the webMethods flow language includes specific flow steps named TRY, CATCH, and FINALLY that you can use to try a sequence of flow steps, catch and handle any failures that occur, and then perform any cleanup work. By providing specific flow steps for the purpose of trying logic, handling failures, and performing clean up tasks, the flow language provides a robust failure handling solution that is easier to read, debug, and maintain than failure handling in previous releases. Additionally, the new failure handling steps are more in keeping with the try-catch behavior provided in other programming languages.
Prior to version 10.3, the webMethods flow language did not include flow steps designed for the specific purposes of trying logic and handling any failures that occurred. Instead, some degree of failure handling could be accomplished using steps like SEQUENCE and REPEAT. By nesting and combining SEQUENCE steps with different exit conditions of failure, success, and done, a flow service could provide a limited form of try-catch behavior. However, using SEQUENCE steps in this manner may result in flow services that are hard to read, debug, and maintain. Additionally, the approach is error prone as it requires the flow service developer to replicate a design pattern repeatedly and to remember to set various properties for each flow step.
The flow behavior introduced with the TRY, CATCH, and FINALLY steps does not affect previously existing flow services. Any existing flow service that is not revised to use the TRY, CATCH, or FINALLY steps and is not modified to use the new EXIT step properties of Failure name and Failure instance introduced in 10.3, will execute as it did before the introduction of the TRY, CATCH, and FINALLY steps.