Professional Documents
Culture Documents
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 Beginners Guide for Oracle SOA. The document focuses on Flow and FlowN activities. Join our professional training program and learn from experts.
Contents
Parallel Processing by using FlowN activity ............................................................................................................................ 3 Flow Activity ................................................................................................................................................................ 3 FlowN Activity ............................................................................................................................................................. 3
Step 4: Fill all its blank spaces [4] Business Intelligence Solution Providers
Name (FlowNProcess) ---->NameSpace (Leave as it is)--->Template(Select Synchronous BPEL Process)---> Service Name(FlowNService)----> mark Expose as a SOAP service --->Click Ok
Step 6: Click on ParallelProcess.xsd & it is automatically generated xsd for sync bpel process. [5] Business Intelligence Solution Providers
Rename Input Element as ProcessNumber & then add sequence ----> then sub elements i.e element1 and Element2 now rename Element1 as NumberA & element2 as NumberB as shown in next 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 that processNumber is bounded from 1 to infinite .
Step 9: Rename complex type as ProcessNumberResultType & right click on it then select sequence [6] Business Intelligence Solution Providers
after sequence create six elements & rename them one by one as numberA ,NumberB, Addition, Subtraction , Multiplication , division respectively .
Step 12: Click on ProcessNumberResult and set type as fobj:ProcessNumberResultType & then hit enter & then expand it by clicking on + sign
Step 13:Right click on sub element "result" of processResponse & then click Toggle Reference ---> rename result as fobj:ProcessNumberResult. Now we have successfully referenced ProcessNumber Result to result element . Also Give minOccurs =1 & maxOccurs = unbounded
Step 14: Click on source mode & view the xsd coding
<?xml version="1.0" encoding="UTF-8"?> <schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:fobj="http://xmlns.oracle.com/SOAApps/FlowNProcess/FlowNProcess" [10] Business Intelligence Solution Providers
targetNamespace="http://xmlns.oracle.com/SOAApps/FlowNProcess/FlowNProcess" xmlns="http://www.w3.org/2001/XMLSchema"> <element name="process"> <complexType> <sequence> <element name="ProcessNumber" maxOccurs="unbounded"> <complexType> <sequence> <element name="NumberA" type="integer"/> <element name="NumberB" type="integer"/> </sequence> </complexType> </element> </sequence> </complexType> </element> <element name="processResponse"> <complexType> <sequence> <element maxOccurs="unbounded" ref="fobj:ProcessNumberResult"/> </sequence> </complexType> </element> <element name="ProcessNumberResult" type="fobj:ProcessNumberResultType"/> <complexType name="ProcessNumberResultType"> <sequence> <element name="NumberA" type="integer"/> <element name="NumberB" type="integer"/> <element name="Addition" type="integer"/> <element name="Subtraction" type="integer"/> <element name="Multiplication" type="integer"/> <element name="Division" type="decimal"/> </sequence> </complexType> </schema> Step 15: Click on FlowProcess.bpel & open bpel process
Step 16 : Drag & drop FlowN Activity from component palette for nesting other activities on it & expand flowN activity by clicking plus sign [+]
Step 17: Drag & drop assign activity between receive & AssignTempVar
flowN
activity
& rename it as
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 [13] Business Intelligence Solution Providers
Step 21: Now double Click on AssignTempVar to open & edit it [14] Business Intelligence Solution Providers
Step 23: Select BPEL XPath Extension Functions under Functions then select & click on Count Nodes --> Insert Into Expressions ---> select ProcessNumber ---> Insert Into Expression the expression should look like this if any other thing appear delete it . ora:countNodes('inputVariable','payload',' /client:process/client:ProcessNumber') then click OK .
Step 27: Drag & drop Scope Activity inside FlowN activity & expand it by clicking on + sign
Step 28: Drag & drop invoke activity from component palette & rename it as InvokeParallelFlow to invoke ParallelProcessingservice
Note : Before invoking any service we need its concrete wsdl i.e wsdl containing binding & service information also . Step 29: Open Oracle's Home ---> jdeveloper ---> mywork --->SOAApps--> ParallelProcessing---> Copy ParallelProcess.wsdl
Step 30: : Open Oracle's Home ---> jdeveloper ---> mywork --->SOAApps-->FlowNProcess ---> paste ParallelProcess.wsdl
Step 31: Open Parallelprocess.wsdl from FlowNProcess in Text editor & make it Concrete wsdl by adding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" & Binding , service Information from run time concrete wsdl from parallel processing inside enterprise manager coding is shown below : <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="ParallelProcess" targetNamespace="http://xmlns.oracle.com/SOAApps/ParallelProcessing/ParallelProcess" xmlns:client="http://xmlns.oracle.com/SOAApps/ParallelProcessing/ParallelProcess" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 XML Schema type and use them as part of the message types. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -> <wsdl:types> <schema xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://xmlns.oracle.com/SOAApps/ParallelProcessing/ParallelProcess" schemaLocation="xsd/ParallelProcess.xsd"/> </schema> </wsdl:types> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MESSAGE TYPE DEFINITION - Definition of the message types used as part of the port type defintions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -> <wsdl:message name="ParallelProcessRequestMessage"> <wsdl:part name="payload" element="client:process"/> </wsdl:message> <wsdl:message name="ParallelProcessResponseMessage"> <wsdl:part name="payload" element="client:processResponse"/> </wsdl:message> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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> [20] Business Intelligence Solution Providers
</wsdl:portType>
<wsdl:binding name="ParallelProcessBinding" type="client:ParallelProcess"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="process"> <soap:operation style="document" soapAction="process"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ParallelProcessService_ep"> <wsdl:port name="ParallelProcess_pt" binding="client:ParallelProcessBinding"> <soap:address location="http://soabpm-vm:7001/soainfra/services/default/ParallelProcessing/ParallelProcessService_ep"/> </wsdl:port> </wsdl:service> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PARTNER LINK TYPE DEFINITION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> <plnk:partnerLinkType name="ParallelProcess"> <plnk:role name="ParallelProcessProvider"> <plnk:portType name="client:ParallelProcess"/> </plnk:role> </plnk:partnerLinkType> </wsdl:definitions> Step 32: Click refresh button till concrete wsdl parallelProcess.wsdl would shown below :
Step 33: Right click on PartnerLinks swim lane & click on Create Partner Link
Step 34: Fill all required fields Name = ParallelFlowRef WSDL URL = Browse ParallelProcess.wsdl Patner Link Type = ParallelProcess Partner Role = ParallelProcessProvider My Role = Not Specified Click OK
Step 35: Now we have Successfully Refrenced ParallelFlowRef now we can observe it on Partner links swim lane .
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_Variable 2. Type = leave as it is 3. Select local variable Click ok [23] Business Intelligence Solution Providers
Step 38: Similarly Output = Click on Green Plus & Create variable window will appear 4. Name= InvokeParallelFlow_process_output_Variable 5. Type = leave as it is 6. Select local variable Click ok
Step 39: look at the variable window & click ok to save the local invoke variables inside scope.
Step 40: Now we have established wiring between InvokeParallelFlow & ParallelFlowref. Click twice on AssignInvokeInput to edit it
Step 41: Map From input Variable/payload//client:processNumber/client:numberA InvokeParallelFlow_process_InputVariable/payload //ns1:process/ns1:NumberA Variable/payload//client:processNumber/client:numberA InvokeParallelFlow_process_InputVariable/payload //ns1:process/ns1:NumberA
TO TO
Step 42: Since we have N number of values of ProcessNumber hence edit FlowNProcess.bpel in source mode by writing [$IndexVar] after client:ProcessNumber as show below <assign name="AssignInvokeInput"> <copy> <from variable="inputVariable" part="payload" query="/client:process/client:ProcessNumber[$IndexVar]/client:NumberA"/> <to variable="InvokeParallelFlow_process_InputVariable" part="payload" query="/ns1:process/ns1:NumberA"/> </copy> <copy> <from variable="inputVariable" part="payload" query="/client:process/client:ProcessNumber[$IndexVar]/client:NumberB"/> <to variable="InvokeParallelFlow_process_InputVariable" part="payload" query="/ns1:process/ns1:NumberB"/> </copy> </assign>
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 it as AssignTempParallelProcess then double click on it to edit it
If we want to map in source mode then code is written below : <assign name="AssignTempParallelProcess"> <copy> <from variable="InvokeParallelFlow_process_OutputVariable" part="payload" query="/ns1:processResponse/ns1:NumberA"/> <to variable="TempProcessNumberResult" query="/client:ProcessNumberResult/client:NumberA"/> </copy> <copy> <from variable="InvokeParallelFlow_process_OutputVariable" part="payload" query="/ns1:processResponse/ns1:NumberB"/> <to variable="TempProcessNumberResult" query="/client:ProcessNumberResult/client:NumberB"/> </copy> <copy> <from variable="InvokeParallelFlow_process_OutputVariable" part="payload" query="/ns1:processResponse/ns1:Addition"/> <to variable="TempProcessNumberResult" query="/client:ProcessNumberResult/client:Addition"/> </copy> <copy> <from variable="InvokeParallelFlow_process_OutputVariable" part="payload" query="/ns1:processResponse/ns1:Subtraction"/> [29] Business Intelligence Solution Providers
<to variable="TempProcessNumberResult" query="/client:ProcessNumberResult/client:Subtraction"/> </copy> <copy> <from variable="InvokeParallelFlow_process_OutputVariable" part="payload" query="/ns1:processResponse/ns1:Multiplication"/> <to variable="TempProcessNumberResult" query="/client:ProcessNumberResult/client:Multiplication"/> </copy> <copy> <from variable="InvokeParallelFlow_process_OutputVariable" part="payload" query="/ns1:processResponse/ns1:Division"/> <to variable="TempProcessNumberResult" query="/client:ProcessNumberResult/client:Division"/> </copy> </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 50: Drag & drop Expression into IndexVar & then Click on IndexVar---> Insert Into Expression ---> +1
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 54: Fill all the required fields as input NumberA = 80 & NumberB=70 NumberA = 60 & NumberB=50 NumberA = 40 & NumberB=30
And get Response shown below: Step 56: Now we have got three output concurrently then click on Launch Flow Trace as shown below :
Step 57:Observe that all states of composite instance are completed & three times invoke activity had called ParallelProcessReference .Click on FlowNProcess to open Flow diagram
Step 59: Observe that the index is incremented & all the three invoke activities are invoked in parallel i.e all the N flows are processing concurrently.
Step 60: Now again open Trace & click on ParallelProcess & view its Flow diagram.
Step 61: Click on Flow & observe ParallelProcess Flow that all the operations are also processing simultaneously & concurrently
Step 62: Open FlowProcess dashboard & click on Shut Down tab to shutdown composite instance