Wednesday, July 18, 2012

Two New BPEL Extension funtions - getBPId() and getGUID()

Originally posted on:

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:
      <assign name="Assign1">
            <from>concat('BPID = [', sxxf:getBPId(), '] GUID = [', sxxf:getGUID(), ']')</from>
            <to variable="NewWSDLOperationOut" part="part1"/>
where the namespace prefix sxxf stands for xmlns:sxxf="" 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.

No comments: