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直方图之秘 0321maclean 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 SQLiowaspindy
 
Java assgn
Java assgnJava assgn
Java assgnaa11bb11
 
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 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 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

Viz Farm Aynne Valencia
Viz Farm Aynne ValenciaViz Farm Aynne Valencia
Viz Farm Aynne Valencia
Aynne Valencia
 
Ted talk your digital ambassador slides
Ted talk   your digital ambassador slidesTed talk   your digital ambassador slides
Ted talk your digital ambassador slides
Akheem Isaac
 
Marcello_salazar_17111611
Marcello_salazar_17111611Marcello_salazar_17111611
Marcello_salazar_17111611
marcellosalazar2
 
161201_CV CPelekani_updated November 2016
161201_CV CPelekani_updated November 2016161201_CV CPelekani_updated November 2016
161201_CV CPelekani_updated November 2016Pelekani Con
 
Imagenes
ImagenesImagenes
Adrianp21230518tarea3
Adrianp21230518tarea3Adrianp21230518tarea3
Adrianp21230518tarea3
adr1anjos3
 
Mountain Apollo India - Business Incubations
Mountain Apollo India - Business IncubationsMountain Apollo India - Business Incubations
Mountain Apollo India - Business Incubations
Pankaj Vermani
 
Apresentacao catalogo 15 Oriflame
Apresentacao catalogo 15 OriflameApresentacao catalogo 15 Oriflame
Apresentacao catalogo 15 Oriflame
Nuno Silva
 
Character design
Character designCharacter design
Character design
Sayed Ahmed
 
Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...
Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...
Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...
Sena Cedagro
 
Estabilizador eletrônico de tensão
Estabilizador eletrônico de tensãoEstabilizador eletrônico de tensão
Estabilizador eletrônico de tensão
MARCDOCS
 
Annotation of still images
Annotation of still images Annotation of still images
Annotation of still images stubbornlove
 
Rio grande room
Rio grande roomRio grande room
Rio grande roomamyvossvuk
 
Haloperidol
HaloperidolHaloperidol
Haloperidol
Soldado Jhonn Peña
 
Document management system ( dms )
Document management system ( dms ) Document management system ( dms )
Document management system ( dms )
Lenora David
 
캐릭터 라이선스 기초
캐릭터 라이선스 기초 캐릭터 라이선스 기초
캐릭터 라이선스 기초
Sam Lee
 
Presentation ppy of grade 6
Presentation ppy of grade 6Presentation ppy of grade 6
Presentation ppy of grade 6
Sumir Harchand
 

Viewers also liked (20)

JihadAbdas-Salaam
JihadAbdas-SalaamJihadAbdas-Salaam
JihadAbdas-Salaam
 
Viz Farm Aynne Valencia
Viz Farm Aynne ValenciaViz Farm Aynne Valencia
Viz Farm Aynne Valencia
 
Ted talk your digital ambassador slides
Ted talk   your digital ambassador slidesTed talk   your digital ambassador slides
Ted talk your digital ambassador slides
 
Marcello_salazar_17111611
Marcello_salazar_17111611Marcello_salazar_17111611
Marcello_salazar_17111611
 
161201_CV CPelekani_updated November 2016
161201_CV CPelekani_updated November 2016161201_CV CPelekani_updated November 2016
161201_CV CPelekani_updated November 2016
 
Imagenes
ImagenesImagenes
Imagenes
 
Spanish Letter of Rec
Spanish Letter of RecSpanish Letter of Rec
Spanish Letter of Rec
 
Adrianp21230518tarea3
Adrianp21230518tarea3Adrianp21230518tarea3
Adrianp21230518tarea3
 
Mountain Apollo India - Business Incubations
Mountain Apollo India - Business IncubationsMountain Apollo India - Business Incubations
Mountain Apollo India - Business Incubations
 
Apresentacao catalogo 15 Oriflame
Apresentacao catalogo 15 OriflameApresentacao catalogo 15 Oriflame
Apresentacao catalogo 15 Oriflame
 
Character design
Character designCharacter design
Character design
 
Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...
Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...
Matriz dofa análisis de entorno externo e interno del servicio nacional de ap...
 
Estabilizador eletrônico de tensão
Estabilizador eletrônico de tensãoEstabilizador eletrônico de tensão
Estabilizador eletrônico de tensão
 
Annotation of still images
Annotation of still images Annotation of still images
Annotation of still images
 
Rio grande room
Rio grande roomRio grande room
Rio grande room
 
Haloperidol
HaloperidolHaloperidol
Haloperidol
 
Document management system ( dms )
Document management system ( dms ) Document management system ( dms )
Document management system ( dms )
 
캐릭터 라이선스 기초
캐릭터 라이선스 기초 캐릭터 라이선스 기초
캐릭터 라이선스 기초
 
NERVOUS SHOCK
NERVOUS SHOCKNERVOUS SHOCK
NERVOUS SHOCK
 
Presentation ppy of grade 6
Presentation ppy of grade 6Presentation ppy of grade 6
Presentation ppy of grade 6
 

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
 
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 IDEBenjamin 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 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 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
 
Custom faultpolicies
Custom faultpoliciesCustom faultpolicies
Custom faultpolicies
xavier john
 
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
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
 
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
 
Custom faultpolicies
Custom faultpoliciesCustom faultpolicies
Custom faultpolicies
 
All adapterscommonproperties
All adapterscommonpropertiesAll adapterscommonproperties
All adapterscommonproperties
 
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

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 

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