The following is a simple example of using Java Embedding Activity in Bpel 11g.
In this example, I used a simple asynch’ process, and assign the input parameter into the output parameter.
To implement this example you have to:
1. Copy this code into the Java Embedding Activity:
try{
Element inputParam= (Element)getVariableData(“inputVariable”,”payload”,”/client:process/client:input”);
addAuditTrailEntry(inputParam.getTextContent());
setVariableData(“outputVariable”,”payload”,”/client:processResponse/client:result”,inputParam.getTextContent());
}
catch( Exception x ){
addAuditTrailEntry(x.getMessage());
}
2. Import class: org.w3c.dom.Element
To do so, in the bpel source code you need to add the next line:
Note: In this example you will have to initialize the output parameter before the Java Embedding Activity.
If you will not do so, an error will be raised during the activity execution
Leave a Reply