SlideShare a Scribd company logo
1 of 5
SOA Fault Framework: Creating and using a Java action fault policy
Quick guide on how to create and deploy a Java action to be used from a fault policies
configuration file. There are several posts about how to create the custom Java action, but
none mentions how to enable it at the server, so here it is.
 1) Create a JDeveloperproject
We're going to use a standard Java project to create the Java action. Create it using
JDeveloper, leaving the default values, and then add the Libraries BPEL Runtime
and SOA Runtime, in order to satisfy the dependencies (right-click over the project
name, then select the last menu entry, "Project properties..."):
Project Libraries
 2) Code the class
The code below is basically a copy from the official documentation. You have to
implement the IFaultRecoveryJavaClass interface, and if you want to access the
BPEL context (to write an audit entry, for instance), you must cast the input parameter
"ctx" to BPELFaultRecoveryContextImpl:
01 package info.mazanatti;
02
03 import com.collaxa.cube.engine.fp.BPELFaultRecoveryContextImpl;
04
import
oracle.integration.platform.faultpolicy.IFaultRecoveryContext;
05
import
oracle.integration.platform.faultpolicy.IFaultRecoveryJavaClass;
06
07
public class CustomFaultJavaAction implements
IFaultRecoveryJavaClass {
08 public void handleRetrySuccess(IFaultRecoveryContext ctx) {
09 System.out.println("This is for retry success");
10 handleFault(ctx);
11 }
12
13
public String handleFault(IFaultRecoveryContext ctx)
{
14 System.out.println("Action context:n" + ctx.toString());
15
16 // Get BPEL specific context here
17
BPELFaultRecoveryContextImpl bpelCtx =
(BPELFaultRecoveryContextImpl) ctx;
18
19 // Writing an audit entry
20 bpelCtx.addAuditTrailEntry("hi there");
21
22 // Getting details
23 System.out.println("Policy Id: " + ctx.getPolicyId());
24
System.out.println("Composite Name: " +
bpelCtx.getCompositeName());
25
26 // Getting an instance variable
27
Element payload =(Element)
bpelCtx.getVariableData("inputVariable", "payload", "/"));
28 Node node = payload.getFirstChild();
29
30
31 // Implement some logic to decide the outcome
32 return "ABORT";
33 }
34 }

Compile the project, and if everything's OK, create a new deployment profile and
generate a JAR file (mine will be "CustomJavaAction.jar"). After creating the
deployment profile, you must open up the same context menu and select the newly
created profile.
 3) Deploy the new package
You have to copy the JAR file to the server and put it inside the
"oracle.soa.ext_11.1.1" directory - you will find it inside SOA Suite product's
directory, not inside the domain.
If you're under Linux, just run this:
locate oracle.soa.ext_11.1.1 | grep build.xml
 Probably, just one result will show up:
/oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ext_11.1.1/bui
ld.xml

After finding the folder, copy CustomJavaAction.jar to it and update the environment
by calling the appropriate setDomainEnv.sh script and then running ANT from the
"soa.ext" folder - this will update the oracle.soa.ext.jar MANIFEST.MF file, adding
a reference to your new file:
$ . /oracle/middleware/domains/soa11g/bin/setDomainEnv.sh
*****************************************************
** Setting up SOA specific environment...
*****************************************************
...
.
USER_MEM_ARGS=-Xms512m -Xmx1024m
.
*****************************************************
** End SOA specific environment setup
*****************************************************
$ cd
/oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ext_11.1.1
$ ant
Buildfile: build.xml
create-manifest-jar:
[echo] Creating oracle.soa.ext at
/oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ext_11.1.1/ora
cle.soa.ext.jar:
/oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ex
t_11.1.1/CustomJavaAction.jar:
/oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ex
t_11.1.1/classes
BUILD SUCCESSFUL
Total time: 1 second

Warning: this procedure is not cluster-friendly. If you're running a cluster, you
must copy the file and run ANT on each physical server that forms the domain.
If the server is running, restart it.
 4) Attach the action to your fault policies
Now, you just have to use the brand new action when defining your fault policies.
Here's my fault-policies.xml:
<?xml version="1.0" encoding="UTF-8"?>
<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<faultPolicy id="customPolicy" version="0.0.1"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.oracle.com/bpel/faultpolicy"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Conditions>
<!-- Any error -->
<faultName>
<condition>
<action ref="custom-java"/>
</condition>
</faultName>
</Conditions>
<Actions>
<Action id="custom-java">
<javaAction className="info.mazanatti.CustomFaultJavaAction"
defaultAction="default-human-intervention">
<returnValue value="ABORT" ref="default-abort"/>
</javaAction>
</Action>
</Actions>
</faultPolicy>
</faultPolicies>

Here are the log entries generated by my custom action:
<Mar 30, 2012 4:31:30 PM BRT> <Notice> <Stdout> <BEA-000000> <Action
context:
[Fault uri=http://schemas.oracle.com/bpel/extension
Fault prefix=
Fault Localpart=remoteFault
[Faulted Activity Details:
Activity Name=Invoke1
Activity Id=BpInv0
Activity lineNumber=75
Partner Link=Service1
Partner Port
type={http://xmlns.oracle.com/Abril_VD/POC_Flow/BPELProcess1}BPELProc
ess1
ActivityType=invoke
]
Instance Id=480010
Fault Policy Id=customPolicy
Fault Policy Action Id=custom-java
Fault Payload=
Key=summary
Value=<summary>oracle.fabric.common.FabricInvocationException: Unable
to access the following endpoint(s):
http://some.faulty.address</summary>
Key=detail Value=<detail>Unable to access the following
endpoint(s): http://some.faulty.address</detail>
Key=code Value=<code>null</code>
]>
<Mar 30, 2012 4:31:30 PM BRT> <Notice> <Stdout> <BEA-000000> <Policy
Id: customPolicy>
<Mar 30, 2012 4:31:30 PM BRT> <Notice> <Stdout> <BEA-000000>
<Composite Name: UseFaultJavaAction>

References:
Adding Custom Classes and JAR Files to SOA
Using Fault Handling in a BPEL Process

More Related Content

What's hot

State of entity framework
State of entity frameworkState of entity framework
State of entity frameworkDavid Paquette
 
Database administration commands
Database administration commands Database administration commands
Database administration commands Varsha Ajith
 
What's new in Cassandra 2.0
What's new in Cassandra 2.0What's new in Cassandra 2.0
What's new in Cassandra 2.0iamaleksey
 
Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...
Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...
Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...webhostingguy
 
Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)Anar Godjaev
 
Code refactoring of existing AutoTest to PageObject pattern
Code refactoring of existing AutoTest to PageObject patternCode refactoring of existing AutoTest to PageObject pattern
Code refactoring of existing AutoTest to PageObject patternAnton Bogdan
 
Form認証で学ぶSpring Security入門
Form認証で学ぶSpring Security入門Form認証で学ぶSpring Security入門
Form認証で学ぶSpring Security入門Ryosuke Uchitate
 
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321maclean liu
 
Owasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiOwasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiowaspindy
 
Java assgn
Java assgnJava assgn
Java assgnaa11bb11
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document StoreI Goo Lee
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentationmrmean
 
This is a basic JAVA pgm that contains all of the major compoents of DB2
This is a basic JAVA pgm that contains all of the major compoents of DB2This is a basic JAVA pgm that contains all of the major compoents of DB2
This is a basic JAVA pgm that contains all of the major compoents of DB2Sheila A. Bell, MS, PMP
 
利用Init connect做mysql clients stat 用户审计
 利用Init connect做mysql clients stat 用户审计 利用Init connect做mysql clients stat 用户审计
利用Init connect做mysql clients stat 用户审计Dehua Yang
 
Azure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesAzure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesJose Manuel Jurado Diaz
 

What's hot (17)

State of entity framework
State of entity frameworkState of entity framework
State of entity framework
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
What's new in Cassandra 2.0
What's new in Cassandra 2.0What's new in Cassandra 2.0
What's new in Cassandra 2.0
 
Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...
Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...
Troubleshooting SQL Server 2000 Virtual Server /Service Pack ...
 
Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)
 
Code refactoring of existing AutoTest to PageObject pattern
Code refactoring of existing AutoTest to PageObject patternCode refactoring of existing AutoTest to PageObject pattern
Code refactoring of existing AutoTest to PageObject pattern
 
Form認証で学ぶSpring Security入門
Form認証で学ぶSpring Security入門Form認証で学ぶSpring Security入門
Form認証で学ぶSpring Security入門
 
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
 
Noinject
NoinjectNoinject
Noinject
 
Owasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiOwasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLi
 
Java assgn
Java assgnJava assgn
Java assgn
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document Store
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentation
 
This is a basic JAVA pgm that contains all of the major compoents of DB2
This is a basic JAVA pgm that contains all of the major compoents of DB2This is a basic JAVA pgm that contains all of the major compoents of DB2
This is a basic JAVA pgm that contains all of the major compoents of DB2
 
利用Init connect做mysql clients stat 用户审计
 利用Init connect做mysql clients stat 用户审计 利用Init connect做mysql clients stat 用户审计
利用Init connect做mysql clients stat 用户审计
 
Azure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesAzure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best Practices
 

Similar to Custom faultpolicies

Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...Tobias Schneck
 
Spring Performance Gains
Spring Performance GainsSpring Performance Gains
Spring Performance GainsVMware Tanzu
 
OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!Tobias Schneck
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Yudep Apoi
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsAndrey Karpov
 
Das kannste schon so machen
Das kannste schon so machenDas kannste schon so machen
Das kannste schon so machenAndré Goliath
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16Benny Neugebauer
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labsAMIT KUMAR
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Amazon Web Services
 
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web TechnologyAyes Chinmay
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEBenjamin Cabé
 
Samsung WebCL Prototype API
Samsung WebCL Prototype APISamsung WebCL Prototype API
Samsung WebCL Prototype APIRyo Jin
 

Similar to Custom faultpolicies (20)

Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
 
Spring Performance Gains
Spring Performance GainsSpring Performance Gains
Spring Performance Gains
 
OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!
 
Play 2.0
Play 2.0Play 2.0
Play 2.0
 
Readme
ReadmeReadme
Readme
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
 
Base de-datos
Base de-datosBase de-datos
Base de-datos
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
 
Das kannste schon so machen
Das kannste schon so machenDas kannste schon so machen
Das kannste schon so machen
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA Austria
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labs
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL
 
Java fx tools
Java fx toolsJava fx tools
Java fx tools
 
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Refreshing mule cache using oracle database change notification
Refreshing mule cache using oracle database change notificationRefreshing mule cache using oracle database change notification
Refreshing mule cache using oracle database change notification
 
Samsung WebCL Prototype API
Samsung WebCL Prototype APISamsung WebCL Prototype API
Samsung WebCL Prototype API
 

More from XAVIERCONSULTANTS (20)

Bpmedn
BpmednBpmedn
Bpmedn
 
Xavier mds upload
Xavier mds uploadXavier mds upload
Xavier mds upload
 
Xavier file adapter_filemoving
Xavier file adapter_filemovingXavier file adapter_filemoving
Xavier file adapter_filemoving
 
Day2 xslt x_path_xquery
Day2 xslt x_path_xqueryDay2 xslt x_path_xquery
Day2 xslt x_path_xquery
 
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
 
Adavanced faulthandling
Adavanced faulthandlingAdavanced faulthandling
Adavanced faulthandling
 
SoaFAQS
SoaFAQSSoaFAQS
SoaFAQS
 
Xpath
Xpath Xpath
Xpath
 
Readme
ReadmeReadme
Readme
 
Bpminto
BpmintoBpminto
Bpminto
 
Bpm
BpmBpm
Bpm
 
Bpmnt-102-edn-integration
Bpmnt-102-edn-integrationBpmnt-102-edn-integration
Bpmnt-102-edn-integration
 
Soaosbcourse_content
Soaosbcourse_contentSoaosbcourse_content
Soaosbcourse_content
 
Oracle soa course_content
Oracle soa course_contentOracle soa course_content
Oracle soa course_content
 
EVENT DELIVERY
EVENT DELIVERY EVENT DELIVERY
EVENT DELIVERY
 
jms-integration
jms-integrationjms-integration
jms-integration
 
Bpelprocess-manager
Bpelprocess-managerBpelprocess-manager
Bpelprocess-manager
 
SOA web services concepts
SOA web services conceptsSOA web services concepts
SOA web services concepts
 
Bpel activities to upload club oracle
Bpel activities to upload club oracleBpel activities to upload club oracle
Bpel activities to upload club oracle
 
FiletodbAdapters
FiletodbAdaptersFiletodbAdapters
FiletodbAdapters
 

Custom faultpolicies

  • 1. SOA Fault Framework: Creating and using a Java action fault policy Quick guide on how to create and deploy a Java action to be used from a fault policies configuration file. There are several posts about how to create the custom Java action, but none mentions how to enable it at the server, so here it is.  1) Create a JDeveloperproject We're going to use a standard Java project to create the Java action. Create it using JDeveloper, leaving the default values, and then add the Libraries BPEL Runtime and SOA Runtime, in order to satisfy the dependencies (right-click over the project name, then select the last menu entry, "Project properties..."): Project Libraries  2) Code the class The code below is basically a copy from the official documentation. You have to implement the IFaultRecoveryJavaClass interface, and if you want to access the BPEL context (to write an audit entry, for instance), you must cast the input parameter "ctx" to BPELFaultRecoveryContextImpl:
  • 2. 01 package info.mazanatti; 02 03 import com.collaxa.cube.engine.fp.BPELFaultRecoveryContextImpl; 04 import oracle.integration.platform.faultpolicy.IFaultRecoveryContext; 05 import oracle.integration.platform.faultpolicy.IFaultRecoveryJavaClass; 06 07 public class CustomFaultJavaAction implements IFaultRecoveryJavaClass { 08 public void handleRetrySuccess(IFaultRecoveryContext ctx) { 09 System.out.println("This is for retry success"); 10 handleFault(ctx); 11 } 12 13 public String handleFault(IFaultRecoveryContext ctx) { 14 System.out.println("Action context:n" + ctx.toString()); 15 16 // Get BPEL specific context here 17 BPELFaultRecoveryContextImpl bpelCtx = (BPELFaultRecoveryContextImpl) ctx; 18 19 // Writing an audit entry 20 bpelCtx.addAuditTrailEntry("hi there"); 21 22 // Getting details 23 System.out.println("Policy Id: " + ctx.getPolicyId()); 24 System.out.println("Composite Name: " + bpelCtx.getCompositeName()); 25 26 // Getting an instance variable 27 Element payload =(Element) bpelCtx.getVariableData("inputVariable", "payload", "/")); 28 Node node = payload.getFirstChild(); 29 30 31 // Implement some logic to decide the outcome 32 return "ABORT"; 33 } 34 }  Compile the project, and if everything's OK, create a new deployment profile and generate a JAR file (mine will be "CustomJavaAction.jar"). After creating the
  • 3. deployment profile, you must open up the same context menu and select the newly created profile.  3) Deploy the new package You have to copy the JAR file to the server and put it inside the "oracle.soa.ext_11.1.1" directory - you will find it inside SOA Suite product's directory, not inside the domain. If you're under Linux, just run this: locate oracle.soa.ext_11.1.1 | grep build.xml  Probably, just one result will show up: /oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ext_11.1.1/bui ld.xml  After finding the folder, copy CustomJavaAction.jar to it and update the environment by calling the appropriate setDomainEnv.sh script and then running ANT from the "soa.ext" folder - this will update the oracle.soa.ext.jar MANIFEST.MF file, adding a reference to your new file: $ . /oracle/middleware/domains/soa11g/bin/setDomainEnv.sh ***************************************************** ** Setting up SOA specific environment... ***************************************************** ... . USER_MEM_ARGS=-Xms512m -Xmx1024m . ***************************************************** ** End SOA specific environment setup ***************************************************** $ cd /oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ext_11.1.1 $ ant Buildfile: build.xml create-manifest-jar: [echo] Creating oracle.soa.ext at /oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ext_11.1.1/ora
  • 4. cle.soa.ext.jar: /oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ex t_11.1.1/CustomJavaAction.jar: /oracle/middleware/soa_11.1.1.5/soa/modules/oracle.soa.ex t_11.1.1/classes BUILD SUCCESSFUL Total time: 1 second  Warning: this procedure is not cluster-friendly. If you're running a cluster, you must copy the file and run ANT on each physical server that forms the domain. If the server is running, restart it.  4) Attach the action to your fault policies Now, you just have to use the brand new action when defining your fault policies. Here's my fault-policies.xml: <?xml version="1.0" encoding="UTF-8"?> <faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <faultPolicy id="customPolicy" version="0.0.1" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Conditions> <!-- Any error --> <faultName> <condition> <action ref="custom-java"/> </condition> </faultName> </Conditions> <Actions> <Action id="custom-java"> <javaAction className="info.mazanatti.CustomFaultJavaAction" defaultAction="default-human-intervention"> <returnValue value="ABORT" ref="default-abort"/> </javaAction> </Action> </Actions> </faultPolicy>
  • 5. </faultPolicies>  Here are the log entries generated by my custom action: <Mar 30, 2012 4:31:30 PM BRT> <Notice> <Stdout> <BEA-000000> <Action context: [Fault uri=http://schemas.oracle.com/bpel/extension Fault prefix= Fault Localpart=remoteFault [Faulted Activity Details: Activity Name=Invoke1 Activity Id=BpInv0 Activity lineNumber=75 Partner Link=Service1 Partner Port type={http://xmlns.oracle.com/Abril_VD/POC_Flow/BPELProcess1}BPELProc ess1 ActivityType=invoke ] Instance Id=480010 Fault Policy Id=customPolicy Fault Policy Action Id=custom-java Fault Payload= Key=summary Value=<summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): http://some.faulty.address</summary> Key=detail Value=<detail>Unable to access the following endpoint(s): http://some.faulty.address</detail> Key=code Value=<code>null</code> ]> <Mar 30, 2012 4:31:30 PM BRT> <Notice> <Stdout> <BEA-000000> <Policy Id: customPolicy> <Mar 30, 2012 4:31:30 PM BRT> <Notice> <Stdout> <BEA-000000> <Composite Name: UseFaultJavaAction>  References: Adding Custom Classes and JAR Files to SOA Using Fault Handling in a BPEL Process