Tuesday, July 8, 2014

SOA Suite 12c: New visual editor for creating Fault Policies

[repost of article at AMIS Technology Blog on July 8th, 2014]

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 Overview

To 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.

12c Fault Policies Editor: Create new Policy Document

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.

12c Fault Policies Editor: Start with clean Template


Lets start by creating two fault policies, one for system fault and one more service faults. You can add fault policies by clicking on the + icon and remove a fault policy by clicking on the X icon when having that policy selected. Give the Fault Policy a name that covers the containing Fault Handlers.

12c Fault Policies Editor: Add / remove Fault Policies

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.

12c Fault Policies Editor: Add action to Fault Handler

You can add multiple actions to a Fault Handler and use contextual if/then/default to select the action to execute.

12c Fault Policies Editor: Add multiple actions

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.

12c Fault Policies Editor: Send Alerts on action 

Alerts, Actions and Properties for custom Interactions

With 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 occurs

When 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.

12c Fault Policies Editor: Actions

TypeFunction
AbortTerminates the entire business flow.
Human InterventionCauses the current activity to stop processing. Human intervention from Oracle Enterprise Manager Fusion Middleware Control is required to handle the fault.
Replay ScopeReplay the scope the Fault occured in.
Rethrow FaultSends the fault to the BPEL fault handlers (catch activities in scope activities).
If none are available, the fault is sent up.
RetryProvides 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 ActionEnables 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.

No comments:

Post a Comment