Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Service Development Help | Building Flow Services | The EXIT Step | Building an EXIT Step
 
Building an EXIT Step
When building an EXIT step in a flow service, keep in mind that only flow steps that act as containers can have an EXIT step as a child. This includes SEQUENCE, BRANCH, REPEAT, LOOP, TRY, CATCH, and FINALLY. Note that a the top-level steps in a flow service are members of an implicit SEQUENCE
For detailed information, including guidelines and restrictions, for using EXIT steps with TRY, CATCH, and FINALLY, see Limitations for the TRY, CATCH, and FINALLY Steps.
*To build an EXIT step
1. If you are inserting an EXIT step into an existing flow service, display that service in the editor and select the step immediately above where you want the EXIT step inserted.
2. Do one of the following:
*Click the button next to on the flow service editor toolbar and click .
*Click by the side of the flow service editor to open the Palette view. Click and drag it to the flow service editor.
3. Complete the following fields on the Properties view:
For this property
Specify
Comments
An optional descriptive comment for this step.
Label
An optional name for this specific step, or a null, unmatched, or empty string ($null, $default, blank).
Important:
If you use this step as a target for a BRANCH step, you must specify a value in the Label property. For more information about the BRANCH step, see The BRANCH Step.
Exit from
The flow step from which you want to exit. Specify one of the following:
Specify
To exit from the...
$parent
Parent flow step, regardless of the type of step. This is the default.
$loop
Nearest ancestor LOOP or REPEAT flow step.
$flow
Entire flow.
$iteration
An iteration of the nearest ancestor LOOP or REPEAT flow step.
label
Nearest ancestor flow step that has a label that matches this value.
Note:
If the label you specify does not match the label of an ancestor flow step, the flow service will exit with a FlowException.
<blank>
Nearest ancestor LOOP or REPEAT flow step. This is the same as specifying a value of $loop.
Signal
Whether the exit is to be considered a success or a failure. Specify one of the following:
Specify
To
SUCCESS
Exit the flow service or flow step with a success condition.
FAILURE
Exit the flow service or flow step with a failure condition. An exception is thrown after the exit. You specify the error message with the Failure message property.
Failure name
The fully qualified Java Class name of the Pending Exception that will be created for this Failure. For example:
java.lang.Exception
com.wm.app.b2b.server.ServiceException
com.wm.lang.flow.FlowException
com.costomerCo.CustomException
Valid class names must be available to the current class loader and must extend java.lang.Exception.
If the class name is not valid, Integration Server throws the default Exception with the following message appended to the Failure message value:
-- class for specified failure not found or invalid
The default value for the Failure name property depends on the Exit from value.
*If Exit from is set to $flow, then the default is com.wm.lang.flow.FlowException.
*For all other Exit from values, the default is com.wm.lang.FlowFailure.
If you want to use the value of a pipeline variable for this property, type the variable name between % symbols (for example, %failure%). The variable you specify must be a String.
When you want the EXIT step to throw an exception, you specify a value for either Failure name or Failure instance properties. If you specify both, Integration Server uses the Failure instance value.
This property is used only when Signal is set to FAILURE.
Failure instance
The name of the pipeline variable that contains an existing Exception instance that you want the EXIT step to identify as the failure. This instance is most likely the failure output parameter of the pub.flow:getLastFailureCaught service.
The specified pipeline variable must be of type Object.
The object variable in the pipeline must extend java.lang.Exception. If it does not, Integration Server throws a FlowException.
If you specify a pipeline variable that exists but does not contain an exception at run time or if you specify a variable that does not exist, Integration Server throws a FlowException and exits the flow service.
This property is used only when Signal is set to FAILURE.
Failure message
The text of the exception message you want to display. If you want to use the value of a pipeline variable for this property, type the variable name between % symbols (for example, %mymessage%). The variable you specify must be a String.
This property is used only when Signal is set to FAILURE.
4. Click File > Save.