SlideShare a Scribd company logo
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 framework
David Paquette
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
Varsha Ajith
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
Manish Mudhliyar
 
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
iamaleksey
 
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 pattern
Anton 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直方图之秘 0321
maclean liu
 
Noinject
NoinjectNoinject
Noinject
Justin Swanhart
 
Owasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiOwasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLi
owaspindy
 
Java assgn
Java assgnJava assgn
Java assgn
aa11bb11
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document Store
I Goo Lee
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentation
mrmean
 
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
Sheila 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 Practices
Jose 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
 

Viewers also liked

Actual problems of science of the XXI century
Actual problems of science of the XXI centuryActual problems of science of the XXI century
Actual problems of science of the XXI century
ISO Cognitio
 
mhmd selim
mhmd selimmhmd selim
mhmd selim
mohamad sabri
 
Households
HouseholdsHouseholds
Households
nowfany
 
Cameron Valades Resume 2015
Cameron Valades Resume 2015Cameron Valades Resume 2015
Cameron Valades Resume 2015
Cameron Valade
 
Powerpoint
Powerpoint Powerpoint
Powerpoint
seenathmol
 
The Mane Effect
The Mane EffectThe Mane Effect
The Mane Effect
yahira lugo
 
Changing Role of the CEO
Changing Role of the CEOChanging Role of the CEO
Changing Role of the CEO
Ed Shapiro
 
Hrm 310 complete class
Hrm 310 complete classHrm 310 complete class
Hrm 310 complete class
laynepettus
 

Viewers also liked (8)

Actual problems of science of the XXI century
Actual problems of science of the XXI centuryActual problems of science of the XXI century
Actual problems of science of the XXI century
 
mhmd selim
mhmd selimmhmd selim
mhmd selim
 
Households
HouseholdsHouseholds
Households
 
Cameron Valades Resume 2015
Cameron Valades Resume 2015Cameron Valades Resume 2015
Cameron Valades Resume 2015
 
Powerpoint
Powerpoint Powerpoint
Powerpoint
 
The Mane Effect
The Mane EffectThe Mane Effect
The Mane Effect
 
Changing Role of the CEO
Changing Role of the CEOChanging Role of the CEO
Changing Role of the CEO
 
Hrm 310 complete class
Hrm 310 complete classHrm 310 complete class
Hrm 310 complete class
 

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 Gains
VMware 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
 
Play 2.0
Play 2.0Play 2.0
Play 2.0
elizhender
 
Readme
ReadmeReadme
Readme
rec2006
 
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
Yudep Apoi
 
Base de-datos
Base de-datosBase de-datos
Base de-datos
ferney1428
 
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
Andrey Karpov
 
Das kannste schon so machen
Das kannste schon so machenDas kannste schon so machen
Das kannste schon so machen
André Goliath
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
Benny 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 hassle
Anton 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 Austria
Rainer Stropek
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labs
AMIT KUMAR
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
GR8Conf
 
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
 
Java fx tools
Java fx toolsJava fx tools
Java fx tools
Tom Schindl
 
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
Ayes 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 IDE
Benjamin Cabé
 
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
Priyobroto Ghosh (Mule ESB Certified)
 
Samsung WebCL Prototype API
Samsung WebCL Prototype APISamsung WebCL Prototype API
Samsung WebCL Prototype API
Ryo 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 xavier john

Unix day4 v1.3
Unix day4 v1.3Unix day4 v1.3
Unix day4 v1.3
xavier john
 
Unix day3 v1.3
Unix day3 v1.3Unix day3 v1.3
Unix day3 v1.3
xavier john
 
Unix day2 v1.3
Unix day2 v1.3Unix day2 v1.3
Unix day2 v1.3
xavier john
 
Interview questions
Interview questionsInterview questions
Interview questions
xavier john
 
Xavier async callback_fault
Xavier async callback_faultXavier async callback_fault
Xavier async callback_fault
xavier john
 
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
xavier john
 
Custom faultpolicies
Custom faultpoliciesCustom faultpolicies
Custom faultpolicies
xavier john
 
Oracle business rules
Oracle business rulesOracle business rules
Oracle business rules
xavier john
 
Soap.doc
Soap.docSoap.doc
Soap.doc
xavier john
 
Soa installation
Soa installationSoa installation
Soa installation
xavier john
 
Vx vm
Vx vmVx vm
Webservices
WebservicesWebservices
Webservices
xavier john
 
While.doc
While.docWhile.doc
While.doc
xavier john
 
Xml material
Xml materialXml material
Xml material
xavier john
 
Xpath
XpathXpath
X query
X queryX query
X query
xavier john
 
Xsd basics
Xsd basicsXsd basics
Xsd basics
xavier john
 
Xsd
XsdXsd
Xslt
XsltXslt
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
xavier john
 

More from xavier john (20)

Unix day4 v1.3
Unix day4 v1.3Unix day4 v1.3
Unix day4 v1.3
 
Unix day3 v1.3
Unix day3 v1.3Unix day3 v1.3
Unix day3 v1.3
 
Unix day2 v1.3
Unix day2 v1.3Unix day2 v1.3
Unix day2 v1.3
 
Interview questions
Interview questionsInterview questions
Interview questions
 
Xavier async callback_fault
Xavier async callback_faultXavier async callback_fault
Xavier async callback_fault
 
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
 
Custom faultpolicies
Custom faultpoliciesCustom faultpolicies
Custom faultpolicies
 
Oracle business rules
Oracle business rulesOracle business rules
Oracle business rules
 
Soap.doc
Soap.docSoap.doc
Soap.doc
 
Soa installation
Soa installationSoa installation
Soa installation
 
Vx vm
Vx vmVx vm
Vx vm
 
Webservices
WebservicesWebservices
Webservices
 
While.doc
While.docWhile.doc
While.doc
 
Xml material
Xml materialXml material
Xml material
 
Xpath
XpathXpath
Xpath
 
X query
X queryX query
X query
 
Xsd basics
Xsd basicsXsd basics
Xsd basics
 
Xsd
XsdXsd
Xsd
 
Xslt
XsltXslt
Xslt
 
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
 

Recently uploaded

What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
kalichargn70th171
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
anfaltahir1010
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 

Recently uploaded (20)

What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 

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