Beruflich Dokumente
Kultur Dokumente
steps to do custom xpath function in Oracle BPEL Process Manager 10.1.3.x. This
is very usefull for basic things (Generate Unique Id ID/Custom DateTime Format
etc ) or more complex things as XML operation).
package com.bpel.xpath;
import java.util.List;
import org.w3c.dom.Node;
import
import
import
import
public
com.collaxa.cube.xml.dom.DOMUtil;
com.oracle.bpel.xml.xpath.IXPathContext;
com.oracle.bpel.xml.xpath.IXPathFunction;
com.oracle.bpel.xml.xpath.XPathFunctionException;
class UniqueTransactionId implements IXPathFunction {
}
uniqueStr = Long.toString(myCurrentTimeUnique) + localVarUnique;
uniqueNumber = Double.parseDouble(uniqueStr);
return (uniqueNumber);
}
To make the Custom Xpath available in jdeveloper we need to unjar the bpm.ide.co
mmon.jar(you can find it under JDEV-HOME/Integration/lib) and update the file or
acle.tib.tools.ide.common.resource.PreBuildExtenstionFunctions.xml and add below
entry at the end.
<functions xmlns:xpfunc1='http://www.oracle.com/XSL/Transform/java/com.bpel
.xpath.UniqueTransactionId'>
<function name="xpfunc1:GenerateUniqueNumb
er" as="string" >
<param name="input" as="string" required
="no"/>
<pcui:ui>
<pcui:mapper palettePage='Advanced Fun
ctions'/>
</pcui:ui>
</function>
</functions>
Now jar bpm.ide.common which includes the updated PreBuildExtenstionFunctions.xm
l file and restart your jdeveloper to use the custom xpath to deploy.
A custom xpath function can be used as any xpath functions. It has to be in an e
xpression field from an assign activity (copy, append, insert after/before, etc.
).
<assign name="UniqueNumber">
<copy>
<from expression="xpfunc1:GenerateUniqueNumber()"/>
<to variable="UniqueID"/>
</copy>
</assign>