Runtime Fault Handling with the Fault Management Framework

4

Fault handling allows a SOA suite component to handle error situations caused by outside web services.
The error situations can be both business (e.g. invalid data value) and runtime faults (service unavailable).
I’m aiming to handle business fault as much as possible in the composite (catch) while handle runtime faults outside the composite.

In the remaining of this blog I will describe an implementation of the Fault Management Framework to handle runtime faults.

I have implemented the following policy:
1) RemoteFault (invocation of a service fails)

  • Start a retry cycle
    standaard retryCount:                 5
    standaard retryInterval:              300 (seconden)
    standaard exponentialBackoff:   2
    Retry will take place after 5, 10, 20, 40 en 80 minutes.
  • If it still fails, start a human intervention

2) All other unhandled (runtime) faults

  • Start a human intervention

The specification of these fault policy is located in the Fault Policy Files.
The fault policy files are loaded at startup, so when any changes are made to them a server restart is required. The two fault policy files we’re  using are stored in the MDS. To use them a reference to them is required in the composite.xml file.  For this, add the following properties:


Policy Files

The content of the policy files is show below:

 

Fault-binding.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>
<faultPolicyBindings version="1.0.0"
    xmlns:xsi=<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>
    xsi:schemaLocation=<a href="http://schemas.oracle.com/bpel/faultpolicy xsd/fault-bindings.xsd">http://schemas.oracle.com/bpel/faultpolicy xsd/fault-bindings.xsd</a>
    xmlns="http://schemas.oracle.com/bpel/faultpolicy"&gt;
    &lt;composite faultPolicy="MOA-FaultPolicy"/&gt;
&lt;/faultPolicyBindings&gt;

 

Fault-policies.xml

&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
&lt;faultPolicies
    xmlns:xsi=<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>
    xsi:schemaLocation=<a href="http://schemas.oracle.com/bpel/faultpolicy xsd/fault-policies.xsd">http://schemas.oracle.com/bpel/faultpolicy xsd/fault-policies.xsd</a>
    xmlns="http://schemas.oracle.com/bpel/faultpolicy"&gt;

    &lt;faultPolicy version="1.0.0" id="MOA-FaultPolicy"
                 xmlns:env=<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>
                 xmlns:xs=<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>
                 xmlns=<a href="http://schemas.oracle.com/bpel/faultpolicy">http://schemas.oracle.com/bpel/faultpolicy</a>
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;

        &lt;Conditions&gt;
            &lt;faultName xmlns:bpelx=<a href="http://schemas.oracle.com/bpel/extension">http://schemas.oracle.com/bpel/extension</a>
                       name="bpelx:remoteFault"&gt;
                &lt;condition&gt;
                    &lt;action ref="ora-retry"/&gt;
                &lt;/condition&gt;
            &lt;/faultName&gt;
            &lt;faultName&gt;
                &lt;condition&gt;
                    &lt;action ref="ora-human-intervention"/&gt;
                &lt;/condition&gt;
            &lt;/faultName&gt;
        &lt;/Conditions&gt;

        &lt;Actions&gt;
            &lt;Action id="ora-retry"&gt;
               &lt;retry&gt;
                  &lt;retryCount&gt;5&lt;/retryCount&gt;
                  &lt;retryInterval&gt;300&lt;/retryInterval&gt;
                  &lt;exponentialBackoff&gt;2&lt;/exponentialBackoff&gt;
                  &lt;retryFailureAction ref="ora-human-intervention"/&gt;
               &lt;/retry&gt;
            &lt;/Action&gt;      
            &lt;Action id="ora-human-intervention"&gt;
                &lt;humanIntervention/&gt;
            &lt;/Action&gt;
        &lt;/Actions&gt;

    &lt;/faultPolicy&gt;
&lt;/faultPolicies&gt;

Human Intervention with the Enterprise Manager

The following screenshot show a Medewerker (Employee) process instance that invokes the unavailable AccountService.

 

After three retries, the instance is waiting for a human intervention.
After the first Error Message at the top of the screen the recovery flag is set. Click on the message and then on the recover now button or immediately on the recovery flag.

 

After selecting the message, the following screen appears.

In this screen you have the possibility to select a Recovery action, change process variables, and invoke the recover operation.

In situation when services are down, after bringing it up again, a retry is quite common (without changing any content).

After recovery the process continues normally.

Also check Greg Mally’s blog post ‘Fault Management Framework by Example’ on Aug 22, 2011 to get a good impression of the functionality of the Framework (https://blogs.oracle.com/ateamsoab2b/entry/fault_management_framework_by_example).

 

Share.

About Author

As a SOA and BPM professional, Marcel is an experienced consultant in the field of process design and process modeling. Within this field system integration and IT-transcending business processes have Marcel's special interest.

4 Comments

  1. Hi Ahmed,

    I want to retry invoking BSSV in case of remote and binding fault and I am using same above fault policy file in my Synch Bpel process to achieve the same.

    I tried using “humanIntervention” instead of RetryAction and it worked
    but “RetryAction” dont work..

    Please suggest me what i can do.

    • Marcel van de Glind on

      Hi Ahmed,

      Sorry for the late reaction.
      All the source code I have used is allready in the post. You do not need anything more.
      If you want ful running examples you probably best can get the source code from the post of Greg Mally’s I referenced to in the post.

Leave a Reply