in 11g Fault Policies were added so that you could easy intervene when a (SOAP/BPEL) fault was thrown. But you could only create them in source mode, there was no graphical editor. With the release of SOA Suite 12c a new visual editor for creating Fault Policies is added to JDeveloper. With the Fault Policy Editor you can now Design and Edit Fault Policies. Besides the already existed functionality a lot of new features are added.
Editor OverviewTo start open/add a existing SOA project (as part of SOA application) and create a new Fault Policy document. Right-click on the SOA project and select option New -> From Gallery. From the gallery select SOA-Tier -> Faults -> Fault Policy Document to create new policy file.
The editor will open with a clean policy document. A policy document can have more then one policy, so faults can be grouped i.g. a policy for system faults and a policy for service faults. For every type of fault you can create a fault handler and for each handler you can select one or more actions. When adding more the one actions you can use a XPath expression to select a filter. With the editor you can also create alerts, property sets and new (custom) actions. Shortly, we will look into the details of the editor.
For every type of fault you can create a fault handler. Select for the first fault the Fault Name that you want to create the Fault Handler for. Fault are categorized in System Faults and Service Faults. Under System Fault you can select between bindingFault, mediatorFault and remoteFault and under Service Faults you can find faults defined in one of the WSDLs the composites uses. If there ain’t any this category is not shown. If you want an other Fault Handler just click on the + icon at right side.
You can select a default action (default is termination) for the list of available actions. If you have created your own action you can also select that one. Some actions may not be shown if there are not applicant to the fault type. For instance a System Fault can’t be redirected to a WS or JMS queue.
You can add multiple actions to a Fault Handler and use contextual if/then/default to select the action to execute.
You can also assign an alert to an action. With this you can send an alert through email, JMS or write alert to a log file. You must first create a Alert to be able to assign one, but we will look at the creation of Alerts later.
Alerts, Actions and Properties for custom InteractionsWith the editor you can also create and edit alerts, property sets and new (custom) actions per Policy. Alerts can be used to send a message to a email address, a JMS queue or write the message to log. With property sets you can create constants that can be used to configure alerts and actions. Actions control what to do when a Fault occurs. Let’s start with explaining actions.
Actions control what to do when a Fault occursWhen creating a new Fault Policies document a set of default actions is created. These default actions show the types that are no support and can be altered to your own liking. You can also create your own actions and delete not used actions.
|Abort||Terminates the entire business flow.|
|Human Intervention||Causes the current activity to stop processing. Human intervention from Oracle Enterprise Manager Fusion Middleware Control is required to handle the fault.|
|Replay Scope||Replay the scope the Fault occured in.|
|Rethrow Fault||Sends the fault to the BPEL fault handlers (catch activities in scope activities).|
If none are available, the fault is sent up.
|Retry||Provides the following options for retrying the activity:|
– Retry a specified number of times.
– Provide a delay between retries (in seconds).
– Increase the interval with an exponential back off.
– Chain to a retry failure action if retry N times fails.
|Java Action||Enables you to execute an external Java class.|
|Invoke WS (new in 12c)||Handles a rejected message by calling a web service (uses a Oracle defined schema).|
|Enqueue (new in 12c)||Enqueues a rejected message to a Queue (AQ) as a JMS message with the appropriate context and payload.|
|File Action (new in 12c)||Creates an error handler for messages by storing a rejected message in a file.|
Read full article on the AMIS Technology Blog.