Try activity

The Try... activity attempts to run the activity or activities in the main Try branch.

About this task

If any exception occurs while running the activity or activities in the main Try branch, the CatchAll branch is run.

Right-clicking the mouse on the background creates a new CatchAll branch.

For example, the main Try branch can call the Database Insert Rows activity as shown in the following figure:

If the Database Insert Rows activity fails and throws an exception, the activity or activities in the CatchAll branch are run. In this example orchestration, when an exception is thrown by the Database Insert Rows activity, the Terminate activity runs thus terminating the current orchestration job.

To add and configure a Try... activity, complete the following steps:

Procedure

  1. Open the Activities tab and the Logic folder.
  2. Drag the Try... activity onto the orchestration. The Try... activity is displayed with the following branches:
    • Try... branch
    • CatchAll branch
    When the first CatchAll branch is created, the following variables are automatically created:
    • faultName - During run time, the faultName variable contains the name of the exception thrown by an activity in the Try branch.
    • faultData - During run time, the faultData variable contains the error message associated with the exception. This additional information is only currently returned for the Web Services activities. For Web Services activities, the faultData variable contains the fault.
    • faultInfo - During run time, the faultInfo variable returns the following nodes:
      • name - During run time, the faultInfo/name node contains the name of the exception thrown by the activity in the Try branch. The faultInfo/name node is a xsd:QName type.
      • message - During run time, the faultInfo/message node contains the error message associated with the exception. The faultInfo/message node is a xsd:string type.
      • activityId - During run time, the faultInfo/activityId node contains the activity ID that uniquely identifies the activity where the exception occurred. The faultInfo/activityId node is a xsd:int type.
      • activityName - During run time, the faultInfo/activityName node contains the activity name where the exception occurred. The faultInfo/activityName node is a xsd:string type.
      • faultTime - During run time, the faultInfo/faultTime node contains the time the error occurred. The faultInfo/faultTime node is a xsd:dateTime type.
      Note: The exception name returned by an activity in the faultName variable and the faultInfo/name node might change in a future release.
  3. Configure the Try... and CatchAll branches by dropping activities from the Activities tab to the branches of the Try... activity as shown in the preceding and following figures.
    Attention: The scope of the faultName, faultData, and faultInfo variables is limited to the CatchAll branch of the Try... activity. This scope limitation means that the value of these variables is only guaranteed to be valid within the CatchAll branch. For example, if you add an If...Then activity that tests the value of the faultName variable, the If..Then activity must be placed inside the CatchAll branch of the Try... activity as shown in the following figure:



Feedback | Notices


Timestamp icon Last updated: Tuesday, 27 September 2016


http://pic.dhe.ibm.com/infocenter/wci/v7r0m0/topic/com.ibm.wci.doc/orch_try_activity.html