This post is specifically about how to maintain and share enterprise level Fault Policies that can be re-used across all your BPM 11g projects. I’m assuming that you know enough about BPM/SOA Suite Exception Handling in general using Fault Policies. If you are looking for more basic information on Fault Handling, check Using Fault Handling In A BPEL Process in the SOA Suite Developer’s Guide.
If you read the SOA Suite Developer’s Guide, it is clear that the best strategy is to maintain your Fault Policy and Fault Binding files in MDS and refer to them from all of your SOA/BPM projects.
Here’s a snippet that shows how to refer to Fault Policies shared via MDS in your composite.xml
Example 12–3 Fault Policies used by Multiple SOA Composite Applications
Although we understood this, the documentation does not explicitly specify how to implement this strategy . Well, to be fair , it kind of does, but the information is pretty scattered across different topics within the Fusion Middleware Documentation. This post aims to bring all the information together in one place so that it becomes an easy reference for anybody trying to implement this strategy.
Here are the steps…
- 1. Create a Shared SOA Application ( I call it SharedMetadataApp) to contain your Fault Policies.
We keep all our shared metadata across projects ( for example, some shared xsd files) in this SOA application. The shared fault policy files can be a part of the same application.
Lets create a new application (I call it SharedMetaDataApp) of type SOA Application.
- 2. Create a SOA project (I call it SharedMetadata) in the SOA application with an empty composite
3. Create a new folder in the SOA project ( I call it FaultPolicies).
This is where we will be placing the Fault Policy and Binding Files.
4. Create the Fault Policy and Binding files in this folder
Here is a starter Fault Policy file.
<?xml version=’1.0′ encoding=’UTF-8′?>
version=”2.0.1″ id=”EnterpriseFaultPolicy” xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/”
Here is a starter Fault Policy Binding file
<?xml version=”1.0″ encoding=”UTF-8″?>
This is how your folder structure should look at this point.
5. Publish the Fault Policy and Binding Files to MDS
a. Create a Jar Deployment Profile for the project.
Navigate to Project Properties /Deployment.
You should see a SOA-SAR File deployment profile
Delete this profile.
Create a new Deployment Profile of type Jar file
In the Deployment Profile properties, deselect the include Manifest file
From Contributors, deselect Project Output Directory and Project Dependencies and add the Sharedmetadata project folder as a Contributor.
Set the filters to select only the files you want to publish to MDS
That should be it for creating the Jar deployment profile.
b. Create a SOA-Bundle deployment profile
Navigate to Application Properties/Deployment and click on new deployment profile.Create a new Deployment Profile of Archive Type SOA Bundle. In the Dependencies select the Jar deployment profile we created in step (a).
6. Create a SOA-MDS Connection in JDeveloper, so that you can view the contents in MDS, once we deploy.
Make sure you select the soa-infra partition.
You will now see the connection in the Resource Palette , IDE Connections.
Expand the /apps folder and you should see that its empty (except for perhaps a readme file, which you can ignore)
7. Deploy the policy files to MDS
Navigate to Application/Deploy/SharedMetadataBundle…
Deploy to Application Server
Deploy to SOA server
After a successful deployment, refresh and expand the apps folder in your SOA-MDS connection ( in Resource Palette/IDE Connections).
You should now see the FaultPolicy folder in there with the FaultPolicy and Binding files.
8. Setting the reference to the Fault Policy in a BPM or SOA application that wants to use this policy.
Add these references in your Composite.xml
Its important that you add these lines after the last service definition and before the first component definition, otherwise the xml will not validate.
9. Deleting the FaultPolicy from MDS.
Here are the steps when you need to do this…in case any folder structure in MDS is obsolete or not correct and you want to recreate it.
Start WLST from the /Middleware /Oracle_SOA1/common/bin
execute the following command from the wlst prompt.
sca_removeSharedData (‘http://oelhost:8001‘, ‘FaultPolicy’, ‘weblogic’, ‘welcome1’)
first parameter : SOA Server url
second parameter : Folder under ‘apps’ you want to delete
third parameter: user id
fourth parameter: password
- Oracle Business Rules: Sums and Averages in Test Conditions - April 2, 2016
- Rolling Up a BPM KPI into Business Architecture Models - January 28, 2016
- The BPM 12c Process Monitor Dashboard in 5 Minutes - January 6, 2016