here are some additional notes:
1. importing syntax:
I'm using BPEL 2.0 this time. This is the importing syntax I'm using now, not sure if it's BPEL 2.0 thing. For sure it's different from my previous post:
add imports right above partner links and right below name spaces.
<import location="oracle.xml.parser.v2.XMLElement" importType="http://schemas.oracle.com/bpel/extension/java"/>
<import location="java.io.File" importType="http://schemas.oracle.com/bpel/extension/java"/>
2. Two ways to get and set variables:
2.1. getting and setting string variables:
nothing fancy, you can do straight:
String foo = (String) getVariableData("foo");
setVariableData("foo", "bar");
2.2. If you need to get to an Xpath in an element, then you have to do something like
XMLElement srcElem = (XMLElement) getVariableData("inputVariable", "payload", "/client:foo/client:bar");
String bar = srcElem.getTextContent();
remember you need to add "import" like in step 1.
3. Gotcha's
Although it's very tempting, don't do this:
String srcElem = (String) getVariableData("inputVariable", "payload", "/client:foo/client:bar");
it doesn't work that way.
If you don't want to deal with the hassles of "importing" and casting, here is a recommended way to go around it.
Using above example:
a) create a BPEL string variable, call it "bar"
b) inside BPEL, assign ("inputVariable", "payload", "/client:foo/client:bar") to the "bar" variable
c) inside your java embedding, you can use get/set freely on "bar", just like in step 2.1 above.