Transcript
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 1/38
[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 haveprepared a complete end-to end Hands-on Beginner’s Guide for
Oracle SOA. The document focuses on Flow and FlowN activities. Join our professional training program and learn from experts.
History:Version Description Change Author Publish Date0.1 Initial Draft Shiva Kant Pandey 21th Aug 20120.1 Review#1 Amit Sharma 29th Aug 2012
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 2/38
[2]
Business Intelligence Solution Providers
ContentsParallel Processing by using FlowN activity ............................................................................................................................ 3
Flow Activity ................................................................................................................................................................ 3
FlowN Activity ............................................................................................................................................................. 3
Stepwise Procedure of Project FlowNProcess by using FlowN activity .................................................................................. 4
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 3/38
[3]
Business Intelligence Solution Providers
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.
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 4/38
[4]
Business Intelligence Solution Providers
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
Step 2: Click Composite with BPEL Process
Step 3: Click Finish
Step 4: Fill all its blank spaces
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 5/38
[5]
Business Intelligence Solution Providers
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.
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 6/38
[6]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 7/38
[7]
Business Intelligence Solution Providers
after sequence create six elements & rename them one by one as numberA ,NumberB, Addition,Subtraction , Multiplication , division respectively .
Step 10: Click on element1 & rename it as ProcessNumberResult
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 8/38
[8]
Business Intelligence Solution Providers
Step 11: Register Namespace with Prefix fobjxmlns:fobj="http://xmlns.oracle.com/SOAApps/FlowNProcess/FlowNProcess"
Step 12: Click on ProcessNumberResult and set type as fobj:ProcessNumberResultType & then hitenter & then expand it by clicking on + sign
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 9/38
[9]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 10/38
[10]
Business Intelligence Solution Providers
<?xml version="1.0" encoding="UTF-8"?><schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:fobj="http://xmlns.oracle.com/SOAApps/FlowNProcess/FlowNProcess"
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 11/38
[11]
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 12/38
[12]
Business Intelligence Solution Providers
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 & flowN activity & rename it asAssignTempVar
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 13/38
[13]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 14/38
[14]
Business Intelligence Solution Providers
Step 20: Now click OK
Step 21: Now double Click on AssignTempVar to open & edit it
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 15/38
[15]
Business Intelligence Solution Providers
Step 22: Drag & drop Expression icon into NVar
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 16/38
[16]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 17/38
[17]
Business Intelligence Solution Providers
Step 25: Initialize IndexVar = 1
Step 26: Take overview of assigned values & then click OK
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 18/38
[18]
Business Intelligence Solution Providers
Step 27: Drag & drop Scope Activity inside FlowN activity & expand it by clicking on + sign
On clicking + sign scope will expand as shown below :
Step 28: Drag & drop invoke activity from component palette & rename it as InvokeParallelFlow toinvoke ParallelProcessingservice
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 19/38
[19]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 20/38
[20]
Business Intelligence Solution Providers
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
enterprise managercoding 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 XMLSchema 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 aspart 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>
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 21/38
[21]
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/soa-
infra/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 :
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 22/38
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 23/38
[23]
Business Intelligence Solution Providers
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
Click ok
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 24/38
[24]
Business Intelligence Solution Providers
Step 38: Similarly Output = Click on Green Plus & Create variable window will appear
4. Name= InvokeParallelFlow_process_output_Variable5. Type = leave as it is6. Select local variable
Click ok
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 25/38
[25]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 26/38
[26]
Business Intelligence Solution Providers
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
<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>
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 27/38
[27]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 28/38
[28]
Business Intelligence Solution Providers
Step 44: Choose ProcessNumberResult then click OK
Step 45: Click ok
Step 46: Drag & drop Assign activity below InvokeParallelFlow from component palette & rename itas AssignTempParallelProcess then double click on it to edit it
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 29/38
[29]
Business Intelligence Solution Providers
Step 47: Map From InvokeparallelFlow_Process_OutputVariable to TempProcessNumber
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"/>
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 30/38
[30]
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 49:Map TempProcessNumberResult/client:ProcessNumberResult to outputVariable/payload/client:processResponse & then Append it .
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 31/38
[31]
Business Intelligence Solution Providers
Step 50: Drag & drop Expression into IndexVar & then Click on IndexVar---> Insert IntoExpression---> +1
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 32/38
[32]
Business Intelligence Solution Providers
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
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 33/38
[33]
Business Intelligence Solution Providers
Step 53:Select Number of node =3 & then click on Explore tab
Step 54: Fill all the required fields as input NumberA = 80 & NumberB=70 NumberA = 60 & NumberB=50 NumberA = 40 & NumberB=30
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 34/38
[34]
Business Intelligence Solution Providers
Step 55: Click on Test Web Service
And get Response shown below:
Step 56: Now we have got three output concurrently then click on Launch Flow Trace as shownbelow :
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 35/38
[35]
Business Intelligence Solution Providers
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.
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 36/38
[36]
Business Intelligence Solution Providers
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 37/38
[37]
Business Intelligence Solution Providers
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 processingsimultaneously & concurrently
Step 62: Open FlowProcess dashboard & click on Shut Down tab to shutdown composite instance
8/13/2019 Oracle SoA Part LAB Xiii
http://slidepdf.com/reader/full/oracle-soa-part-lab-xiii 38/38
Step 63: Click Yes
Now successfully Shutdown the composite
Finally logout Enterprise Manager & stop admin server .
top related