Studio Visual Editor
-
If you have not already done so, create a global 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.
-
Double-click to open the Reference Exception Strategy, use the drop-down to reference the global catch exception strategy (below), then click OK 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. |
You can create a global exception strategy (i.e. access the Choose Global Type panel) from the reference exception strategy’s pattern properties panel. Click the button next to the Global Exception Strategy drop-down and follow the steps to create a global catch, rollback, or choice exception strategy. |
Studio XML Editor or Standalone
-
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.)
<catch-exception-strategy name="Catch_Exception_Strategy">
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</catch-exception-strategy>
<flow name="Creation1Flow1" doc:name="Creation1Flow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<cxf:jaxws-service doc:name="SOAP"/>
...
<exception-strategy ref="Catch_Exception_Strategy" doc:name="Reference Exception Strategy"/>
</flow>
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. |