Two New BPEL Extension funtions - getBPId() and getGUID()
By Malkit-Oracle on Sep 29, 2008
BPEL Service Engine, part of Open ESB Project recently added two new Extension functions to return the Process Instance Id and a New GUID respectively. These functions are available in BPEL Mapper Pallet in Netbean's BPEL Editor. So, what might be good use of these functions. Of top of my head, I can think of the following:
- For creating unique Correlation Keys: Often times state-ful interactions are required between interacting partners exchange asynchronous messages. BPEL describes correlation mechanism to make such interaction possible. These correlation tokens are embedded in the messages that are passed around in such interactions. Any of these newly added getGUID() or getBPID() extension functions can easily be used to create such correlation tokens.
- For Auditing and Debugging purposes: getBPID() that returns the process instance id can be used for these purposes.
Following is the usage of these funtions, as shown in the example below:
<from>concat('BPID = [', sxxf:getBPId(), '] GUID = [', sxxf:getGUID(), ']')</from>
<to variable="NewWSDLOperationOut" part="part1"/>
where the namespace prefix sxxf stands for xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" which need to be imported into your BPEL Definition file. Of course, Netbean's BPEL Editor comes with powerful mapper (screenshot below), that makes usage of these funtions like a breeze.