Redigera

Dela via


Adding a Catch Exception Block

The Catch Exception block represents an exception handler. Catch Exception blocks are attached to the end of a Scope shape in Orchestration Designer. You can attach as many Catch Exception blocks as you need.

You can set up exception handlers to handle different kinds of exceptions. On each exception handler, you specify an exception type, which must be either an exception or an object derived from the class System. If an exception is thrown that matches the specified type in an exception handler, that exception handler is called.

Note

To add a Catch Exception block to a Scope shape, the Transaction Type property of the Scope shape must be set to None or Long Running.

Adding and populating a Catch Exception block
1. Right-click the Scope shape that you want to add a Catch Exception block to, and click New Exception Handler.
A Catch Exception block is added to the orchestration immediately following the associated Scope shape.
2. In the Properties window, specify the properties. The most important is the Exception Object Type; this is the type of message it will catch.
Exception Object Name
- Assigns a name to the exception object caught by the exception handler.
Exception Object Type
- Determines the object type (derived from System.Exception) that this exception handler will catch.
3. In the Properties window, open the Exception Object Type list. This list contains the General Exception.
4. Inside the Catch Exception block, add shapes to create the process for handling the exception.
5. Right-click below the Catch Exception, point to Insert Shape, and select Construct Message.
6. Double-click inside MessageAssignment to activate the Text Editor, and enter the Message assignment.
For example, type in Message_3 = Test.
Screenshot that shows the BizTalk Expression Editor.

See Also

Completing the Exception Message
How to Add a Scope Shape
Using BizTalk Server Exception Handling