[1] Business Intelligence Solution Providers Getting Started with Oracle SOA BASIC CONCEPT OF ORACLE SOA Lab#13 Description: BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Beginner’s Guide for Oracle SOA. The document focuses on Flow and FlowN activities. Join our professiona l training program and learn from experts.History: Version Description Change Author Publish Date 0.1 Initial Draft Shiva Kant Pandey 21th Aug 2012 0.1 Review#1 Amit Sharma 29 th Aug 2012
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
ContentsParallel Processing by using FlowN activity ............................................................................................................................ 3
Stepwise Procedure of Project FlowNProcess by using FlowN activity .................................................................................. 4
Parallel Processing by using FlowN activityA BPEL process service component must sometimes gather information from multiple
asynchronous sources. Because each callback can take an undefined amount of time , it may taketoo long to call each service one at a time. By breaking the calls into a parallel flow, a BPEL processservice component can invoke multiple web services at the same time, and receive the responses asthey come in. This method is much more time efficient.So there are two Parallel Process Activities these are :
Flow Activity: The Flow activity is used to configure parallel activity in BPEL processes. Intheory, activities contained in two or more branches (sequence containers) inside a Flowactivity are executed in parallel.
FlowN Activity: The flowN activity creates multiple flows equal to the value of N, which isdefined at runtime based on the data available and logic within the process. An indexvariable increments each time a new branch is created, until the index variable reaches thevalue of N.
Simply we can say if we know number of operations to be processed in parallel then we can easilypredict the number of flows in Flow activity but if we don't have previous information of number ofoperations & so can't predict the count of flow so for this reason we need FlowN activity & hence wesimply assume number of operations is N & an index which is assigned equal to 1 & hence it askfor N number of flows to process in parallel .
NOTE: The FlowN activity creates multiple flows equal to the value of N , which is defined atruntime.
Stepwise Procedure of Project FlowNProcess by using FlowN activityStep 1: Create new projectNew --->All Technologies--->SOA Tier --->SOA project --->OK ---> Project Name (FlowNProcess) --->ADF Business Component---> SOA--->Next
Name (FlowNProcess) ---->NameSpace (Leave as it is)--->Template(Select Synchronous BPELProcess)---> Service Name(FlowNService)----> mark Expose as a SOAP service --->Click Ok
Step 5: Open Composite.xml & observe BPEL Process
Step 6: Click on ParallelProcess.xsd & it is automatically generated xsd for sync bpel process.
Rename Input Element as ProcessNumber & then add sequence ----> then sub elements i.eelement1 and Element2 now rename Element1 as NumberA & element2 as NumberB as shown innext figure.
Step 7: Open property inspector & then click on ProcessNumber , now see propery inspector &
give minOccurs = 1 & maxOccurs = unbounded then click enter now see xsd in design mode thatprocessNumber is bounded from 1 to infinite .
Step 8: Click on Schema targetNamespace & Create an additional Element & a Complex TypeElement
Step 9: Rename complex type as ProcessNumberResultType & right click on it then select sequence
Step 13:Right click on sub element "result" of processResponse & then click Toggle Reference --->rename result as fobj:ProcessNumberResult. Now we have successfully referenced ProcessNumberResult to result element .Also Give minOccurs =1 & maxOccurs = unbounded
Step 14: Click on source mode & view the xsd coding
Step 18: To create global variables click on variable icon then "Variable" window will appear----> Click on Green plus ---> Create Variable window will appear ---> Name = NVar ---> click on Type ---> Click on Browse icon & choose integer type ---> ok
Step 19: Again Click on Green plus ---> Create Variable window will appear ---> Name = IndexVar ---> click on Type ---> Click on Browse icon & choose int type ---> ok
Step 23: Select BPEL XPath Extension Functions under Functions then select & click on CountNodes --> Insert Into Expressions ---> select ProcessNumber ---> Insert Into Expressionthe expression should look like this if any other thing appear delete it .ora:countNodes('inputVariable','payload',' /client:process/client:ProcessNumber')then click OK .
Step 24: Drag & drop Expression icon into IndexVar
Note : Before invoking any service we need its concrete wsdl i.e wsdl containing binding & serviceinformation also .Step 29: Open Oracle's Home ---> jdeveloper ---> mywork --->SOAApps--> ParallelProcessing--->Copy ParallelProcess.wsdl
Step 30: : Open Oracle's Home ---> jdeveloper ---> mywork --->SOAApps-->FlowNProcess ---> pasteParallelProcess.wsdl
Step 31: Open Parallelprocess.wsdl from FlowNProcess in Text editor & make it Concrete wsdl byadding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"& Binding , service Information from run time concrete wsdl from parallel processing inside
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TYPE DEFINITION - List of services participating in this BPEL process The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XMLSchema type and use them as part of the message types.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
MESSAGE TYPE DEFINITION - Definition of the message types used aspart of the port type defintions~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
><!-- portType implemented by the ParallelProcess BPEL process --><wsdl:portType name="ParallelProcess"><wsdl:operation name="process"><wsdl:input message="client:ParallelProcessRequestMessage"/><wsdl:output message="client:ParallelProcessResponseMessage"/></wsdl:operation>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PARTNER LINK TYPE DEFINITION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
Step 35: Now we have Successfully Refrenced ParallelFlowRef now we can observe it on Partnerlinks swim lane .
Step 36: Right click on InvokeParallelFlow
Step 37: Edit Invoke Name = InvokeParallelFlow Partner Link = Browse ParallelFlowRef Operation = Process Input = Click on Green Plus & Create variable window will appear
1. Name= InvokeParallelFlow_process_Input_Variable2. Type = leave as it is3. Select local variable
Step 41: Map From input Variable/payload//client:processNumber/client:numberA TOInvokeParallelFlow_process_InputVariable/payload //ns1:process/ns1:NumberAVariable/payload//client:processNumber/client:numberA TOInvokeParallelFlow_process_InputVariable/payload //ns1:process/ns1:NumberA
Step 42: Since we have N number of values of ProcessNumber hence edit FlowNProcess.bpel insource mode by writing [$IndexVar] after client:ProcessNumber as show below
Step 43 : To create global variables click on variable icon then "Variable" window will appear----> Click on Green plus ---> Create Variable window will appear ---> Name = TempProcessNumberResult ---> click on Element ---> Click on Browse icon
Step 46: Drag & drop Assign activity below InvokeParallelFlow from component palette & rename itas AssignTempParallelProcess then double click on it to edit it
</assign>Step 48: Drag & drop Assign activity below AssignTempParallelProcess from component palette &rename it as AssignOutput then double click on it to edit it
Step 49:Map TempProcessNumberResult/client:ProcessNumberResult to outputVariable/payload/client:processResponse & then Append it .
Step 51: Deploy FlpowNProcess Project by right clicking on left pane on FlpowNProcess -->Deploy ---> FlpowNProcess ---> Application server --->devsoa (select server domain) -->AdminServer--->Next ---> Finish
Deployment finished
Step 52: Click On browser ---> Start Enterprise manger -----> login using credentials (username
weblogic & password : welcome1) , now click twice on FlpowNProcess [1.0] composite then Click on Test to test the composite instance
Step 57:Observe that all states of composite instance are completed & three times invoke activityhad called ParallelProcessReference .Click on FlowNProcess to open Flow diagram
Step 58: Click on Flow
Step 59: Observe that the index is incremented & all the three invoke activities are invoked inparallel i.e all the N flows are processing concurrently.