webMethods 10.2 | Service Development Help | Building Flow Services | The SEQUENCE Step | Using SEQUENCE to Specify an Exit Condition
 
Using SEQUENCE to Specify an Exit Condition
In an implicit sequence, when a step fails, Integration Server automatically exits the sequence. (This is the same behavior as an explicit sequence for which the Exit on property is set to FAILURE.) By grouping steps into an explicit sequence, you can override this default behavior and specify the condition on which the SEQUENCE exits. To do this, you set the Exit on parameter as follows:
Set “Exit on” to…
If you want Integration Server to…
FAILURE
Exit the SEQUENCE when a step in the SEQUENCE fails. Execution continues with the next flow step in the flow service. This is the default behavior for a SEQUENCE.
Exiting upon failure is useful if you have a series of steps that build upon one another. For example, if you have a set of steps that gets an authorization code and then submits a PO, you will want to skip the PO submission if the authorization step fails.
When a SEQUENCE exits under this condition, the SEQUENCE step fails.
Note: A failure by a transformer in a MAP step causes the containing SEQUENCE to exit when Exit on is set to FAILURE.
Note: When a SEQUENCE step exits on failure, Integration Server rolls back the pipeline contents, returning the pipeline to the state it was in before the SEQUENCE step executed.
SUCCESS
Exit the sequence when any step in the SEQUENCE succeeds. Execution continues with the next step in the flow service.
Exiting upon success is useful for building a set of alternative steps that are each attempted at run time. Once one of the members of the set runs successfully, the remaining steps in the SEQUENCE are skipped.
If a child step in a SEQUENCE configured to exit on success fails, any changes that the child step made to the pipeline are rolled back (undone), and processing continues with the next child step in the SEQUENCE.
Note: Successful execution by a transformer in a MAP step does not cause the containing SEQUENCE to exit when Exit on is set to SUCCESS.
If all the child steps fail in a SEQUENCE configured to exit upon success, Integration Server considers the SEQUENCE step successful.
Note: If you do not want a SEQUENCE configured to exit on success to be successful if all the child steps fail, insert an EXIT step as the last step in the SEQUENCE. Configure the EXIT step to exit from the flow and signal a failure. Specifically, set the Exit from property to $flow and the Signal property to FAILURE. At run time, if all the other child steps in the SEQUENCE fail and the child EXIT step succeeds, Integration Server exits the SEQUENCE with a failure condition. Integration Server throws an exception after the exiting the SEQUENCE.
DONE
Execute every step in the SEQUENCE.
Integration Server considers a SEQUENCE step configured to exit on done to be successful as long as it executes all of its children within the specified time-out limit. The success or failure of a child step within the SEQUENCE is not taken into consideration. If a child step fails, any changes that it made to the pipeline are rolled back (undone), and processing continues with the next child step in the SEQUENCE.
Integration Server considers a SEQUENCE step configured to exit on done to fail if all of the child steps do not execute within the specified time-out limit.
Note: Rollback operations are performed on the first level of the pipeline only. That is, first-level variables are restored to their original values before the step failed, but the server does not roll back changes to any documents to which the first-level variables refer.

Copyright © 2017-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release