Try Catch

It helps you to configure steps which potentially raises an exception and steps to handle the exception.

The Try Catch activity contains a Try activity, a Catch activity and a Finally activity. The steps or actions that can cause exception are configured in the Try activity block. If the Try activity throws an exception, the exception is matched with the exception defined in the Catch activity block. If the exception matches, the steps or actions configured in the Catch activity block are executed. The Finally activity is executed irrespective of occurrence of an exception. Steps or actions in the Finally activity block are configured to be executed when either the Try activity or any required action in the Catch activity completes. If the exception does not match, the Finally activity block is not executed and the exception is passed to the parent activity.

The parent activity (an activity block, for example, an Application activity) has an option to consume the error by setting its Ignore Error property to Yes. The automation process workflow is terminated if the parent activity at the root level of the workflow does not consume the error.

 

Using Try Catch Activity

  1. In the Canvas Tools pane, click Exception Handling to expand the tool and view the associated activities.
  2. Drag the Try Catch activity and drop on to the Flowchart designer on the Canvas.

 

 

  1. Double click the TryCatch activity block to configure the required steps or the actions. By default, the Try activity is expanded.

 

 

  1. In the Try activity block, drag and drop the activity that can potentially throw an exception. Whenever the exception occurs, the workflow moves to the Catch activity block.
  2. Click and expand the Catch activity block.

 

 

  1. In the Define Exception field, enter the exception message that appears in the Try activity block.
  2. In the Catch activity block, drag and drop the activity to handle the exception that appears in the Try activity block.
  3. Click and expand the Finally activity block.

 

 

  1. In the Finally activity block, drag and drop the activity that must be executed when either Try or Catch activity completes.

The Try Catch activity is configured.

 

Try Catch Activity Properties

The properties of Try Catch activity are listed in the following table and can be edited in the Properties grid on the right pane.

 

Property Name

Usage

DisplayName

The display name of the activity in the flowchart designer area. By default, the name is set as TryCatch. You can change the name as required.