Reference Exception Strategy

You can create one or more global exception strategies to reuse in flows throughout your entire Mule application. First, create a Mule Configuration File and add a Reference Exception Strategy to a flow to reference the error handling behavior of a specific global exception strategy.

When to Use

Use a reference exception strategy to instruct a flow to employ the error handling behavior defined by a global rollback exception strategy. In other words, you must ask your flow to refer to the configuration file for instructions on how to handle errors.

Applying a Global Rollback Exception Strategy to a Flow

If you have not already done so, create a configuration file as described in the catch, rollback, or choice exception strategy to which your reference exception strategy can refer.

From the Error Handling palette group, drag and drop the reference exception strategy icon into the footer bar of a flow.

Open the Reference Exception Strategy’s Properties Editor, use the drop-down to reference the global catch exception strategy (below), then click anywhere on the canvas to save.

You can append a Reference Exception Strategy to any number of flows in your Mule application and instruct them to refer to any of the global catch, rollback, or choice exception strategies you have created. You can direct any number of reference exception strategies to refer to the same global exception strategy.

To your flow, below all the message processors, add an exception-strategy element.

To the exception-strategy element, add attributes according to the table below. Refer to code below.

Attribute

Value

ref

Name of the global catch-exception-strategy in your project.

doc:name

Unique name for the exception strategy, if you wish. (Not required in Standalone.)

You can append a Reference Exception Strategy to any number of flows in your Mule application and instruct them to refer to any of the global catch, rollback, or choice exception strategies you have created. You can direct any number of reference exception strategies to refer to the same global exception strategy.