Tuesday, 16 January 2018

Setting Composite Instance Title in BPEL

Hi All,

This post is about naming your Composite Instance so that it can be easily identified among a pile of instances.

"setCompositeInstanceTitle function sets the composite instance title and returns it.  In  BPEL you must assign the return value to a variable"

Use case: Suppose we are getting orders for different items and we would like to identify each order based upon some Unique OrderID. Then instead of going through the audit trail/flow to find out; we can try to add unique id along with composite instance id in Composite Instance Title.

Such that it is easy to identify which instance is processing which OrderID.

Demonstration:

I am taking my previous developed composite - Correlation to demonstrate setting of Composite Instance Title.

Steps:

1. Add Assign activity after Receive like below:


2. Add a global variable Title of type String


3. Edit Assign then Add function to newly added variable Title:




Choose from Advanced Function; Ora:setCompositeInstancetitle() ; then 
add concat (orderID+CompositeInstanceID)

Actual xpath:

ora:setCompositeInstanceTitle(concat('OrderID',bpws:getVariableData('inputVariable','part','/client:Order/client:OrderID'),' ',' ','CompositeInstanceID-', ora:getCompositeInstanceId()))

4. Save all and Deploy

Test: 

1. Testing with inputs: OrderID - 03


 2. Checking Composite name:


Thus, we can see our use case has been achieved, now instance name has OrderID and InstanceID.

Let's keep exploring SOA!

More to come
- Krithika :) 

No comments:

Post a Comment