Try Catch Activity
Description:
Contains workflow elements to be executed by the workflow runtime with an exception handling block.
Inheritance Hierarchy:
System.Object
System.Activities.Activity
System.Activities.NativeActivity
System.Activities.Statements.TryCatch
Function:
Errors occur when a workflow cannot run as intended. The TryCatch activity makes it possible to undertake corrective action when an error occurs.
Potentially errant activities can be placed in the Try block. If an error occurs, the activities in the Catch block will be executed. Activities within the Finally block will be executed when the Try and any necessary activities in the Catch block complete execution.
The TryCatch activity does not catch exceptions thrown by external activities.
In a Workflow:
If you wish to run a query on a map service that is intermittently unavailable, you could put a Query Task Activity in the Try block of a TryCatch, and add an Alert activity and a TerminateWorkflow activity in the Catch block. If the service is down, an exception will be raised by the Query Task and handled within the Catch block by rendering an alert to the user and then terminating the workflow.
Properties:
Name | Description |
---|---|
Display Name |
TryCatch You can change the name of an activity to one that describes what it does. A descriptive name can make a workflow easier to interpret and maintain. |
Try |
The workflow element first executed when the TryCatch executes. |
Catches |
The collection of Catch elements to be checked when the Try activity throws an exception. |
Finally |
The workflow element to be executed when the Try, and any necessary activities in the Catches collection, complete execution. |
Version Information:
Supported from: Geocortex Essentials 3.0.
For more information:
https://msdn.microsoft.com/en-us/library/system.activities.statements.trycatch.aspx