Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Service Development Help | Failure Handling in Flow Services Using the TRY, CATCH, and FINALLY Steps | Building TRY, CATCH, and FINALLY Steps
 
Building TRY, CATCH, and FINALLY Steps
Before adding the TRY, CATCH, FINALLY steps to a flow service, make sure to review the limitations listed in Limitations for the TRY, CATCH, and FINALLY Steps.
*To build TRY, CATCH, and/or FINALLY steps
1. If you are inserting a TRY step into an existing flow service, display that service in the flow service editor. Highlight the step immediately above where you want to insert the TRY step.
2. Do one of the following:
*Click the button next to on the flow service editor toolbar and click TRY-CATCH or TRY-FINALLY
*Click by the side of the flow service editor to open the Palette view. Click TRY-CATCH or TRY-FINALLY and drag it to the flow service editor.
Designer inserts either TRY and CATCH steps or TRY and FINALLY steps into the flow service.
3. Build the TRY step by doing the following:
a. Set the TRY step properties using the information in the following table:
Property
Description
Comments
An optional descriptive comment for this step.
Scope
The name of a document (IData object) in the pipeline to which you want to restrict this step. If you want this step to have access to the entire pipeline, leave this property blank.
Timeout
Optional. Specifies the maximum number of seconds that this step should run. If this time elapses before the step completes, Integration Server issues a FlowTimeoutException and execution continues with the next step in the service.
If you want to use the value of a pipeline variable for this property, type the variable name between % symbols. For example, %expiration%. The variable you specify must be a String.
If you do not need to specify a time-out period, leave Timeout blank.
For more information about how Integration Server handles flow step timeouts, refer to the description of the watt.server.threadKill.timeout.enabled configuration parameter in webMethods Integration Server Administrator’s Guide.
Label
An optional name for this specific step, or a null, unmatched, or empty string ($null, $default, blank). 4
Important:
If you use this step as a target for an EXIT step that exits from a specific label, you must specify a value in the Label property. TRY, CATCH, and FINALLY steps may only be targets of an EXIT step that signals success. For more information about the EXIT step, see The EXIT Step.
Exit on
This property is always set to FAILURE for a TRY step.
b. Beneath the TRY step, insert one or more child steps for the TRY step. The child steps are the sequence of steps that you want Integration Server to attempt.
If necessary, indent the flow steps using on the flow service editor toolbar to make the steps children of the TRY step.
Set the properties for the child step as needed.
4. If you want the service to handle any failures that occur in the TRY step, do the following:
a. If a CATCH step does not exist immediately below the TRY step, add a CATCH step right by clicking button next to on the flow service editor toolbar and then clicking or dragging a in from the Palette view.
b. Set the CATCH step properties using the property information in the following table:
Property
Description
Comments
An optional descriptive comment for this step.
Scope
The name of a document (IData object) in the pipeline to which you want to restrict this step. If you want this step to have access to the entire pipeline, leave this property blank.
Timeout
Optional. Specifies the maximum number of seconds that this step should run. If this time elapses before the step completes, Integration Server issues a FlowTimeoutException and execution continues with the next step in the service.
If you want to use the value of a pipeline variable for this property, type the variable name between % symbols. For example, %expiration%. The variable you specify must be a String.
If you do not need to specify a time-out period, leave Timeout blank.
For more information about how Integration Server handles flow step timeouts, refer to the description of the watt.server.threadKill.timeout.enabled configuration parameter in webMethods Integration Server Administrator’s Guide.
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 an EXIT step that exits from a specific label, you must specify a value in the Label property. TRY, CATCH, and FINALLY steps may only be targets of an EXIT step that signals success. For more information about the EXIT step, see The EXIT Step.
Exit on
This property is always set to FAILURE for a CATCH step.
Failures
Specifies the list of failures that the CATCH step either specifically handles or does not handle. When Selection is set to INCLUDE, the Failures property lists the failures the CATCH step handles. When Selection is set to EXCLUDE, the Failures property lists the failures the CATCH step does not handle.
Click to open the Catch failures dialog box and specify the class names of the Exceptions.
Leave the Failures property empty if you want the CATCH step to handle the last failure thrown regardless of what it is.
You can use a Java regular expression for the failure name. For more information, see CATCH Step Considerations.
Selection
Specifies whether the CATCH step handles failure included in the Failures list or only failures that are not in the Failures list.
Specify
To
INCLUDE
Catch any of the failures specified in the Failures property.
EXCLUDE
Catch any failures except those specified in the Failures property.
c. Beneath the CATCH step, insert each step that you want to use to handle the failures that occur.
Indent that flow step using on the editor toolbar to make it a child of the CATCH step.
Set the properties for the child steps as needed.
5. Repeat step 4 for each CATCH step that you want to add.
6. If you want the service to include a FINALLY step that will execute regardless of the outcome of the TRY and CATCH statements, do the following:
a. If a FINALLY step does not exist for the TRY step added in step 2, add a FINALLY step right by clicking button next to on the flow service editor toolbar and then clicking or dragging a in from the Palette view.
b. Set the FINALLY step properties using the property information in the following table:
Property
Description
Comments
An optional descriptive comment for this step.
Scope
The name of a document (IData object) in the pipeline to which you want to restrict this step. If you want this step to have access to the entire pipeline, leave this property blank.
Timeout
Optional. Specifies the maximum number of seconds that this step should run. If this time elapses before the step completes, Integration Server issues a FlowTimeoutException and execution continues with the next step in the service.
If you want to use the value of a pipeline variable for this property, type the variable name between % symbols. For example, %expiration%. The variable you specify must be a String.
If you do not need to specify a time-out period, leave Timeout blank.
For more information about how Integration Server handles flow step timeouts, refer to the description of the watt.server.threadKill.timeout.enabled configuration parameter in webMethods Integration Server Administrator’s Guide.
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 an EXIT step that exits from a specific label, you must specify a value in the Label property. TRY, CATCH, and FINALLY steps may only be targets of an EXIT step that signals success. For more information about the EXIT step, see The EXIT Step.
Exit on
This property is always set to FAILURE for a FINALLY step.
c. Beneath the FINALLY step, insert each step that you want to use to handle the failures that occur.
Indent that flow step using on the editor toolbar to make it a child of the FINALLY step.
Set the properties for each child step as needed.
7. Click File > Save.