Transcript of Getting started-with-oracle-so a- lab 11
- 1. Getting Started with Oracle SoA Oracle SOA Asynchronous BPEL
Process Callback Lab#11 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
Asynchronous BPEL Process Callback. Join our professional training
program and learn from experts. History: Version 0.1 0.1
Description Change Initial Draft Review#1 www.bispsolutions.com
Author Shiva Kant Pandey Amit Sharma www.bisptrainigs.com Publish
Date 21st Aug 2012 29th Aug 2012 www.hyperionguru.com Page 1
- 2. Asynchronous BPEL Process Callback ASYNCHRONOUS BPEL
PROCESS: An Asynchronous Process is one which you call and need not
wait for the response before proceeding further. You may just
initiate the Asynchronous process and receive the response when you
require it as a part of your process, hence you are not forced to
wait for response. Real life example of a Synchronous process: You
call a friend and ask him to give you some information. While your
friend is finding out the information for you, you are on the call
waiting for his response. Note that connection is not dropped Real
life example of an Asynchronous process: You call a friend and ask
him to give you some information. You ask him to call you back when
the information is ready and you disconnect the call. When your
friend is ready with the information, he calls you and gives you
the information. Note that you dont wait for a response from your
friend and connection is lost. When your friend is ready, he has to
establish a new connection and then provide you the information
Procedure for asynchronous process student BPEL Process project
Step 1: Create new project New --->All Technologies--->SOA
Tier --->SOA project --->OK ---> Project Name
(ProcessStudentAsync) ---> ADF Business Component--->
SOA--->Next www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 2
- 3. Composite with BPEL Process---> Finish Step2 : Fill all
its blank spaces Name (ProcessStudentAsync) ---->NameSpace
(Leave as it is)--->Template(Select Asynchronous BPEL
Process)---> Service Name(ProcessStudentAsyncService)---->
mark Expose as a SOAP service --->Click Ok www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 3
- 4. Step3: Open Composite.xml & observe BPEL Process
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 4
- 5. Step 4: Click on ProcessStudentAsync.xsd & it is
automatically generated xsd for Async bpel process Step 5: : Open
ProcessStudentAsync.xsd & Right Click on target namespace &
click import www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 5
- 6. Step 6: View empty import in design mode Step 7: Click on
source mode & modify import by providing namespace &
schemalocation of Student.xsd from oramds. www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 6
- 7. Step 8: Copy Schema location of Student.xsd from Resource
Palette SOA-MDS by using shortcut keys CTRL+SHIFT+C & Paste
inside ProcessStudentAsync.xsd as shown below & delete all text
inside indicated red box Replace all text inside indicated red box
with oramds: Step 9: Provide namespace & schema location of
Student.xsd from oramds www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 7
- 8. Step 10: Register Student.xsd namespace with prefix inside
xml schema
xmlns:stdobj="http://www.bispsolutions.com/training/soa/schema/Student"
Step 11:Edit element name & their type for process &
process response . www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 8
- 9. Step 12: Preview xsd on design mode Step 13: : Drag &
Drop Assign Activity & rename it as AssignTempMarks & click
to edit it . www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 9
- 10. Step 14: : Create TotalVar , AvgVar, ResultVar all assigned
as integer Type & ResultVar as string type then click OK
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 10
- 11. Step 15: Click ok Step 16: To assign TotalVar click on
expression Drag & Drop on TotalVar as shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 11
- 12. Step 17: Click Lang1Marks ---> insert into expression
---> plus sign(+)--> Lang2Marks---> insert into expression
---> plus sign(+)--> Lang3Marks---> insert into
expression---> Click Ok Step 18: : Click Expression Drag it
& keep it in AvgVar under Variables Click TotalVar under BPEL
Variables---> insert into expression ---> Select Mathematical
Function choose Divide --> insert into expression --->
3.0(Since number of subjects are three )---> OK
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 12
- 13. Step 19: Click Ok Step 20: : Drag Switch activity From
Component Palette located at Right Pane of window & keep it in
between AssignTempMarks & CallbackClient www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 13
- 14. Step 21: Click on Condition Click on Xpath Expression
builder to set condition Click Lang1Marks ---> insert into
expression ---> greater equals 35--> Lang2Marks---> insert
into expression ---> greater equals 35--> Lang3Marks--->
insert into expression--> greater equals 35--> Click Ok Step
22: Drag & Drop Assign activity under true condition &
rename it as AssignPASS as shown below www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 14
- 15. Step 23: Click on Copy Rules Click Expression Drag it &
keep it in ResultVar under Variables Write under Expression 'PASS'
and click Ok Step 24: Drag & Drop Assign activity under true
condition & rename AssignFAIL as shown below
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 15
- 16. Step 25: Click on Copy Rules Click Expression Drag it &
keep it in ResultVar under Variables Write under Expression 'FAIL'
and click Ok To assign output drag & drop Assign activity as
shown below & edit it as AssignOutput Step 26: Map
ProcessResponse as shown in diagram so that we can get output
response according to mapping elements then click OK
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 16
- 17. Step 27: Assign output completed & also BPEL process
completed Now Click on Compile Icon shown below Successful
compilation with 0 errors & 0 warnings www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 17
- 18. NOTE: Since we have completed asynchronous BPEL Process
calling service now next aim to create a new caller service i.e
StudentProcessoneway BPEL Process Process Step 28: Create new
project New --->All Technologies--->SOA Tier --->SOA
project --->OK ---> Project Name (StudentProcessOneWay)
---> ADF Business Component---> SOA--->Next
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 18
- 19. Step 29: Click on Composite with BPEL Process
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 19
- 20. Step 30: Fill all its blank spaces Name
(StudentProcessOneWay) ---->NameSpace (Leave as it
is)--->Template(Select One Way BPEL process)----> Service
Name(StudentProcessOneWayService)----> mark Expose as a SOAP
service --->Click Ok www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 20
- 21. Step 31: Open Composite.xml & observe BPEL Process
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 21
- 22. Step 32: Click on StudentProcessOneWay.xsd & it is
automatically generated xsd for one way bpel process . Step 33: :
Open StudentProcessOneWay.xsd & Right Click on target namespace
& click import Step 34: Click on source mode & Import
Student.xsd & also register it as shown below 1. Import
Student.xsd from oramds under resource palette by provide its
namespace & schemalocation 2. Register its namespace following
with its prefix stdobj 3. Rename element name & its type as
shown below www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 22
- 23. Step 35: Explore Process--> Student--> ( Name,
Number, Email, Lang1Marks, Lang2Marks, Lang3Marks )
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 23
- 24. Step 36: Open StudentProcessOneWay. bpel , Drag & Drop
invoke activity from component palette Step 37: Before Invoking
ProcessStudentAsync Service copy ProcessStudentAsync.wsdl from
ProcessStudentAsync Project folder . Open jdeveloper --->
mywork--->SOAApplication---> ProcessStudentAsync--->
ProcessStudentAsync.wsdl www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 24
- 25. Step 38: Paste ProcessStudentAsync.wsdl into
StudentProcessOneWay Project folder . Open jdeveloper --->
mywork--->SOAApplication---> StudentProcessOneWay --->
ProcessStudentAsync.wsdl www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 25
- 26. Step 39: Now Open recently pasted wsdl in Text Editor &
make this abstract wsdl into concrete by adding binding &
service information . Step 40: Deploy ProcessStudentAsync Project
on Application server www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 26
- 27. Step 41: Click on ProcessStudentAsync & open it Step
42: Open concrete runtime wsdl by clicking on the following link
shown below : www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 27
- 28. Step 43: Copy soap registration from this run time wsdl
xmlns:soap="http://schema.xmlsoap.org/wsdl/soap/" Step 44: Paste
copied registration into Text Editor www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 28
- 29. Step 45: Copy ws policy from run time wsdl as shown below :
Step 46: Paste copied ws policy inside ProcessStudentAsync.wsdl
opened in Text Editor as shown below : www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 29
- 30. Step 47: Copy Binding & service information from run
time ProcessStudentAsync wsdl www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 30
- 31. Step 48 Paste copied binding & service information
inside ProcessStudentAsync.wsdl opened in Text Editor as shown
below : Now save all by clicking save all icon at the top &
close all tabs . Step 49: Refresh by clicking refresh icon so after
refreshing observe ProcessStudentAsync.wsdl under
StudentProcessOneWay Project at left pane , then click on it to
open . www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 31
- 32. Step 50: Open ProcessStudentAsync concrete wsdl in design
mode & observe following points Port Types : One is Process for
receiving input & other ProcessResponse for providing response
after call back Bindings /PartnerLinkTypes : first binding contains
policy reference & this policy referencing directly towards ws
addressing policy second binding is for processing response for
call back & lastly observe that this callback service has two
roles i.e provide & requester . Services : Since here wsdl is
concrete & so contains services . Imports is showing warning
& so we have to check the problem in source mode & try to
resolve it . so after diagnosis found that ProcessStudentAsync.xsd
is missing under StudentProcessOneWay ---> xsd , so now our aim
is to copy it from ProcessStudentAsync ---> xsd physically &
paste it inside StudentProcessOneWay ---> xsd
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 32
- 33. Step 51: Copy ProcessStudentAsync.xsd from jdeveloper-->
my work --> SOAApplication--> ProcessStudentAsync
-->xsd---> ProcessStudentAsync.xsd Step 52: : Paste
ProcessStudentAsync.xsd inside jdeveloper--> my work -->
SOAApplication-> StudentProcessOneWay -->xsd & then close
all tabs www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 33
- 34. Step 53: Click Refresh icon till ProcessStudentAsync.xsd
does not appear under StudentProcessOneWay Project
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 34
- 35. Observe that we have resolve imports warning Step 54: Drag
& Drop partnerlink web service from BPEL Constructs into
Partner links swim lane Name : ProcessStudentAsync WSDL URL :
ProcessStudentAsync.wsdl (Browse it by clicking its icon ) Partner
Link Type: ProcessStudentAsync Partner Role : ProcessStudentAsync
Provider My Role : ProcessStudentAsync Requester Click OK
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 35
- 36. Step 55: Created ProcessStudentAsync as PartnerLink as
shown below : Step 56: Now Drag & Drop Invoke activity &
Edit Invoke Name: InvokeProcessStudentAsync Partner Link :
ProcessStudentAsync Operation : Process Click on green plus &
Create Variable 1. Name : ProcessStudentAsync_InputVariable 2. Type
: auto generate 3. Select Global variable 4. Click Ok Click OK
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 36
- 37. Step 57: Look at the wiring between Invoke activity &
third party service ProcessStudentAsync service
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 37
- 38. Step 58: Drag & drop receive activity from the
Component Palette & click on it to edit www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 38
- 39. Since calling service is Asynchronous BPEL call back
service & hence it needs receive activity to receive invoked
response. Step 59: Edit receive Activity Name:
ReceiveProcessStudentAsync Conversation Id : Leave as it is Partner
Links: ProcessStudentAsync Operation : ProcessResponse Create
Variable by clicking green plus 1. Name:
ReceiveProcessStudentAsync_OutputVariable 2. Type : Auto generate
3. Global variable 4. Click Ok Click OK www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 39
- 40. Step 60: Observe that in asynchronous call back process all
other activities after invoke does not wait for invoke process but
they work simultaneously & receive the response whenever needed
through receive activity & so there is arrangement of message
id that the given input is processed & provide to exactly the
same caller by same message id so if there is enormous amount of
messages are placed then it keeps in queue & process the data
& keep that large amount of processed data with their message
id's of instances . www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 40
- 41. Step 61: Drag & drop assign activity from component
palette into component swim lane between receive input & invoke
ProcessStudentAsync & rename it as AssignInvokeInput &
click to edit it. Step 62: Map all data from inputvariable to
ProcessStudentAsync_Input variable www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 41
- 42. /client:process/client:Student/ns2:Name
--------------------------/ns1:process/ns1:Student/ns2:Name
/client:process/client:Student/ns2:Number------------------------/ns1:process/ns1:Student/ns2:Number
/client:process/client:Student/ns2:Email---------------------------/ns1:process/ns1:Student/ns2:Email
/client:process/client:Student/ns2:Lang1Marks-------------------/ns1:process/ns1:Student/ns2:Lang1Marks
/client:process/client:Student/ns2:Lang2Marks------------------/ns1:process/ns1:Student/ns2:Lang2Marks
/client:process/client:Student/ns2:Lang3Marks------------------/ns1:process/ns1:Student/ns2:Lang3Marks
Click Ok Step 63: Drag & drop Email Notification below
receiveProcessStudentAsync & rename it as Email student
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 42
- 43. Step 64: Click on Email student ---> click expression
for "TO" ---> Email ---> Insert into Expression &
Expression look like :
bpws:getVariableData('ReceiveProcessStudentAync_OutputVariable','payload','/ns1:proc
essResponse/ns1:StudentResult/ns2:Email') Click Ok Step 65: : Click
on Email student ---> click expression for "Subject" --->
Name ---> Insert into Expression www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 43
- 44. & Expression look like :
bpws:getVariableData('ReceiveProcessStudentAync_OutputVariable','payload','/ns1:proc
essResponse/ns1:StudentResult/ns2:Name') Click Ok Step 66: Click on
Email student ---> click expression for "Body" --->
StudentResult ---> Insert into Expression & Expression look
like : <
%bpws:getVariableData('ReceiveProcessStudentAync_OutputVariable','payload','/ns1:pro
cessResponse/ns1:StudentResult')%> Click Ok
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 44
- 45. Step 67: click Ok Step 68 : Save all & then Compile by
clicking into compile icon shown below www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 45
- 46. Compilation : 0 errors , 0 warnings . Step 69: Deploy
StudentProcessOneWay to dev soa (application server ) NOTE :
"Before deploying composite start admin server" . Deployment
finished www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 46
- 47. Step 70: Click On browser ---> Start Enterprise manger
-----> login using credentials (username : weblogic &
password : welcome1) , now click twice on StudentProcessOneway[1.0]
composite Step 71: Click on Test to test the composite instance
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com
Page 47
- 48. Step 72: Input required data in all blank fields &
click to TestWebService Step 73: Message for web service invocation
was successful is Shown below & also an email is sent to the
student so click Launch Flow Trace www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 48
- 49. Step 74: Notice that state is completed ,Click on
StudentProcessOneWay Step 75: To observe the flow chart of the
composite , Click FlowTrace ----> Flow & then observe both
the figures www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 49
- 50. Fig(1) Fig(2) Step 76: Click on Invoke notification &
see the details of Student sent Email Also notice the message ID of
the notification at last of message . www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 50
- 51. Step 77: Come back to StudentProcessOneWay Composite home
& click on ShutDown tab Step 78: Successfully ShutDown the
composite . also shut down the admin server www.bispsolutions.com
www.bisptrainigs.com www.hyperionguru.com Page 51
- 52. www.bispsolutions.com www.bisptrainigs.com
www.hyperionguru.com Page 52