SOA Admin—Fault recovery for BPMN processes

You learnt how to define fault policies for a BPMN process in Chapter 8, Exception Management, in the Handling a system exception Fault Management Framework section.

In Chapter 8, Exception Management, BPMN Service Engine runs the task ValidateStock, which calls StockValidator_EBS. StockValidator_EBS will raise an error if stock is not available. The task fails with a SOAP error, which will be converted by BPMN Service Engine into an exception. Here, you will use the framework to define a fault policy that enables human intervention on a BPMN process and you will also perform recovery on BPMN process components.

You will implement a service task in your BPM process to invoke this StockValidator_EBS service.

If Stock = Available Then Process Token follows the Normal path

else if Stock != Available then service task throws a Error

How to do it...

  1. Open the fault-policy.xml file and add the following code:
    <faultName xmlns:client="http://xmlns.oracle.com/Implementation/StockCheckingService/StockValidator"
    name="client:SOPFault">
    <condition>
    <test>$fault.payload = "UnAvailable"</test>
    <action ref = "ora-human-intervention"/>
    </condition>
    </faultName>
    

    If availability is 'N', then StockValidator_EBS will raise a SOPFault and will be handled by the policy framework.

  2. In fault-policy.xml, you have defined human intervention action. Without fault policies, BPMN instances do not generate recoverable faults (instead they are non recoverable); the ora-human-intervention action makes the fault recoverable.
  3. Deploy and run an instance of the process. Enter the product as 1030, as with this Product Code; StockValidator_EBS will have availability as 'N' and this service will result in SOPFault, which you will handle using the fault policy framework.
    How to do it...

    You can find that a fault instance is created.

  4. Log in to the Enterprise Manager console as WebLogic user and go to soa-infra.
  5. Click on Faults and Rejected Messages.
  6. Select the fault that has been identified as recoverable and select it.
  7. In the Recovery column, click on Recover. The Faults page for that BPMN process instance is displayed. You can find the fault recovery section at the bottom of the page.
  8. Select Retry from the Recovery Action list.
  9. From the Variable list, select a variable which contains the Availability Data and In the Value field, enter the correct value Y.
  10. Click on Set Value, and click Yes when prompted to continue.
  11. Click Recover to recover from the fault, then click Yes when prompted to continue.

    You should see that the page will get refreshed and indicates that no faults occurred.

How it works...

You created a StockValidator_EBS BPEL web service ,based on a PLSQL procedure, which checks for item availability in MTL_SYSTEM_ITEMS table and returns SO0050Fault if item not available.

When this fault is raised, policy framework will handle this fault, in this case. And you can perform the fault recovery from Oracle EM console.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.244.250