Split Join in OSB
This article is from the excellent Blog by oraclefusion1011.
See complete article here - [Link] . It is reproduced here for easy reference only. This is one of an interesting feature in OSB , however if you know how FlowN works in Bpel this will appears to be same. Use Case: Orders -> Multiple Items Services : 1. Get each Item Status (Instock/outStock) 2. Get Order Status. Now split join splits the input request to multiple threads and executes parallely. Like in this case for an Order with 10 items , 10 threads will get spawned. Resources: XSD : Order/Item Element WSDL : for ItemStatus Service and Order Status service Bpel : Implement the getItemStatus service for inividual item OSB : 1. create a project for split join 2. Import XSD and both WSDl While importing wsdl it may create xsd as well , update the source with imported xsd from xsd folder and then delete the created one. 3. Create a Buss Service based on Item WSDL (get url from EM), this will be invoked as part of split join [Link] 4. Create split join based on getOrderStatus Service , select operation. - It will create Receive and Reply activity and request and response variables as well - initialize the response variable by adding an assign action , Put this Assign action right after Receive <ord:Order xmlns:ord="[Link] </ord:Order> - add a ForEach Flow Control to iterate each item in Order parallel = yes
counter var = loop start counter = 1 final counter = count($[Link]/Items) - Add invoke service for the check Item status for each Item inside for each Before invoke and inside scope --------------------------------------------- create input/output scope variable for the service invoke - Add another var "Param" to pass the value to the Service - Add assign action inside the for each , initialize input variable for service <ord:Item xmlns:ord="[Link] </ord:Item> - Add copy operation to copy items to Param from exp : $[Link]/Items[$loop] to exp : $[Link] - Add replace to replace the service input with Param Replace "." in [Link] with Exp : $[Link] Replace entire node --------------------------------------------- After the service invoke add Insert Exp : $[Link] LOcation : as first chil of Xpath : . Variable : [Link] 5. Right click split [Link] -> OSB -> Generate BS Thats it split join is done !! This is how it will look like in eclipse: