Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
s a
) h a
o m
c ideฺ
i l ฺ
Oracle SOA g ma 11g:
Suite t G u
Build
o @ e n
Composite
r c S tud
ad Applications
ฺ m e this
m in usIe• Activity Guide
Volume
ฺ j a z to
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
D53946GC20
Edition 2.0
September 2010
D65409
Author Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Anand Sidgiddi Sheela Vasudevan share, download, upload, copy, print, display, perform, reproduce,
publish, license, post, transmit, or distribute this document in whole or in
Anirudh Pucha Stephanie McReynolds part without the express authorization of Oracle.
Jay Kasi o
ad Editors le
Joe Greenwald r c
e feArijit a b
r Ghosh
John Cobb a M s
KalpakE rik n-tran Nita Pavitran
Kothari
Ken Cooper no
Graphic Designer
Kevin Clugage
Rajiv Chandrabhanu
Khanderao Kand
Kristopher Rice
Publisher
Lloyd Williams
Syed Imtiaz Ali
Lynn Munsinger
Manoj Das
Mark Kennedy
Melody Yang
Mohan Kamath
Peter Laseau
Prabhu Thukkaram
Prasad Dixit-Hardikar
Prasen Palvankar
Rakesh Saha
Rashmi Menon
Robert LaVallie
Contents
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
ฺ j a zm to us
Practice 5-1: Create the CreditCardValidation SOA Project........................................ 69
e r ika ense
Practice 5-2: Create a Database Adapter to Query Credit Cards .................................. 78
Practice 5-3: Deploy and Test the CreditCardValidation Composite........................... 91
o ( lic
Practices for Lesson 6 ....................................................................................................... 93
d l e
rca erab
Practice 6-1: Restructure the POProcessing Assembly Model ..................................... 94
e
M nsf
Practice 6-2: Calculate Order Totals with XSL Transformations................................. 99
a
k
Eri on-tra
Practice 6-3: Test the Modified POProcessing Application ....................................... 107
Practices for Lesson 7 ..................................................................................................... 111
nPractice 7-1: Add BPEL Components to the POProcessing Assembly Model .......... 112
Practice 7-2: Add Filters to the EnrichPO Mediator Routing Rules........................... 121
Practice 7-3: Design the initial ApproveCCOrder BPEL Process .............................. 126
Practice 7-4: Design the initial Fulfillment BPEL Process......................................... 143
Practice 7-5: Deploy and Test POProcessing with BPEL Components ..................... 150
Practices for Lesson 8 ..................................................................................................... 158
Part 1 ........................................................................................................................... 161
Practice 8-1: Create the CreditCardValidation External Reference ........................... 161
Practice 8-2: Invoke Credit Card Validation from ApproveCCOrder ........................ 165
Part 2 ........................................................................................................................... 180
Practice 8-3: Invoke the Fulfillment Process from ApproveCCOrder........................ 180
Practice 8-4: Invoke JMS Adapters in the Fulfillment BPEL Process ....................... 189
Practice 8-5: Deploy and Test the POProcessing Composite Application ................. 218
Practices for Lesson 9 ..................................................................................................... 230
Practice 9-1: Deploy ADF Application Projects as Services...................................... 232
Practice 9-2: Modify InternalStore with Pick and While Activities ........................... 238
iii
Practice 9-3: Modify OnlineStore with a FlowN Activity.......................................... 264
Practice 9-4: Deploy and Test InternalStore and OnlineStore Applications .............. 273
Practice 9-5: Add a Flow to the Fulfillment BPEL Process ....................................... 286
Practice 9-6: Deploy and Test POProcessing with Stock Checks .............................. 316
Practices for Lesson 10 ................................................................................................... 328
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
iv
Information about XML Element Names in Practice Documentation
Consider the XML tree structure in the following image of JDeveloper’s XSLT Mapper:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
In the sample image observe that each XML element (the tree nodes below the
<sources> root) has an XML namespace prefix, such as “imp1:” in the image
s a
h a
example. The XML namespace prefix, which maps to an XML Namespace string, is:
)
• Used to uniquely identify (qualify) each XML element o m
c ideฺ
i l ฺ
• Generated dynamically by the JDeveloper tool that creates the XML structure.
g ma t Gu
When you carry out the practice instructions in this document, dynamically generated
o @ den
XML namespace prefixes for your XML elements may differ from those shown in the
d
screenshots of this document.
e rca is Stu
i n ฺm e th
Note: Therefore, the practice instructions do not specify the XML namespace prefixes for
j zm to us
XML elements that you work with, even though the screenshots related to those
a
instructions contain XML namespace prefix values. The screenshots are provided as
ฺ
e r ika ense
sample and guide. Your job is to ensure that the XML element names and structures
( lic
created, mapped, or referenced are correct as documented, and not to be concerned about
o
d l e
rca erab
different XML namespace values.
e
a M nsf
k
Eri on-tra
n
Note: The Oracle Database 10g Enterprise Edition server should already be running.
If you have connection problems, request for assistance from the instructor.
2) In the JDeveloper window, click the View > Resource Palette menu.
3) On the JDeveloper Resource Palette, click the New icon ( ) and select New
Connection > Database.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
4) In the Database Connection dialog box, enter the a
rcfollowing
S tu
details:
e
m e this
a) Use the IDE Connections option. inฺ
j a zm to us
b) Enter the following fieldฺvalues:
Connection Name: e r ikasoademo
e n se
Username:do
( lic
soademo
l e
rca erab soademo
Password:
e
a M
Hostname:
n s f localhost
r i k -t r
Port: a 1521
E onSID: XE
n
Note: The Connection Name value is case-sensitive!
c) Select the Save Password option, and accept the default values for the remaining
fields.
d) Click Test Connection to verify that you can successfully connect to the database,
and then click OK.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Admin Server icon on the desktop. Wait until the server is started. You can verify this
when you see the text similar to the following display in the terminal window:
2) Start the SOA Server (managed server) by double-clicking the Start SOA Server icon
on the desktop. Wait until the server is started. You can verify this when you see the
text similar to the following display in the terminal window: s a
) h a
INFO: FabricProviderServlet.stateChanged SOA Platform o m
is
c ideฺ
running and accepting requests i l ฺ
g ma t Gu
o @ SOA
Note: You can ignore the warnings displayed in the command
d e nServer command
d
window.
e rca is Stu
i n
3) In the JDeveloper Resource Palette, clickฺm
New icon
e t(h ) > New Connection >
Application Server.
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
4) On the Create Application Server Connection wizard pages, enter the information
specified in the following table:
Step Screen/Page Description Choices or Values
a. Create Application Server On the Name and Type page enter:
Connection – Step 1 of 5 Connection Name: soaserver
Accept default for other items, and click Next.
b. Create Application Server On the Authentication page enter:
Connection – Step 2 of 5 Username: weblogic
Password: welcome1
Click Next.
Next.
d. Create Application Server On the Test page:
Connection – Step 4 of 5 Click Test Connection.
Ensure a success result is displayed for all eight
tests, and click Finish.
Note: If you require help to perform this task, refer to the following screenshots for
guidance to the steps described in the preceding table of instructions:
a)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nb)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d)
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: The UTF-8 encoding setting is recommended for ADF-based JSF
applications that are generated for use in the Oracle SOA Worklist application to
display tasks for assignees in human workflow functionality.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
j a zm us
displays taoline number for each line of source code.
Note: Show Line Numbers ฺ
r ika etonlocate
This is a useful preference
e se specific lines of code reported for compiler
o
errors and when ( variouslidesign-time
c tools detect errors in your application code
a d l e
M erc ferab
or structures.
r i ka -trans
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
Note: If you o (
are working licwith these practices in a non-Oracle University
d l e
rca ethen
environment
e r abit is likely that you do not have to change this preference. It
M f
s whether your corporate network proxy allows or denies access to
r i ka depends
r a
various
n on
external URLs in HTTP requests that are used by JDeveloper.
E on-t
3) nIn the Preferences window, click OK to apply the selected preference changes. Close
the Preferences window.
1) In the JDeveloper Resource Palette window, click the New icon ( ) > New
Connection > WSIL.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
2) On theeWSILrca Connection
e r ab wizard pages, enter the information specified in the
M s f
r i kafollowing
-t r a
table:
n
E SteponScreen/Page Choices or Values
n Description
a. Welcome Click Next.
b. Connection Type Accept the default settings.
Click Next.
c. WSIL URL WSIL File:
http://localhost:8001/inspection.wsil
Click Next.
d. Authentication Username: weblogic
Password: welcome1
Click Next.
e. Finish Click Finish.
Note: Use the following screenshots if you require guidance through the steps
described in the preceding table of instructions:
s a
) h a
b) m
l ฺ o
c ideฺ
i
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nc)
s a
h a
)expand
3) To confirm that the WSIL connection is operational, on the Resource Palette o m
csee twoideฺ
the WSIL node and expand the WSILConnection1 entry. You should i l ฺ
subfolders called: soa-infra and usermessagingserver, as shown
g minathe tfollowing
G u
image:
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Editor to enable you to make some comparisons based on questions asked in the
practices.
The following images provide a partial visual representation of the po.xsd and
internalorder.xsd files:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
In addition, you examine the CREDITCARDS
j a zm totableusdata in the soademo database
schema used by the purchase order
k ฺ
a processing
e application.
r i n s
The following image o (e lithe c e
c d ble JDeveloper Database Navigator window, from which
represents
amodify,
e r
you can browse,
e r a and create database structures, as well as query and modify the
M f
r i k -trans
dataathey contain:
E on
n
Note: Familiarization with some of the data and data structures facilitates understanding
the application design and implementation tasks performed in subsequent practices.
1) In the JDeveloper window, select the File > Open menu and browse for and open the
D:\labs\files\files.jws file.
Note: If the Open Warning dialog box is displayed, at the “Do you want to migrate
these files?” prompt click Yes. In the Migration Status dialog box, click OK.
2) To examine the purchase order XML schema, perform the following steps:
a) In the JDeveloper Application Navigator, in files project expand the Application
Sources > xsd folders.
b) Double-click the po.xsd file to open the file in the XSD Editor. s a
h a
) data
c) Expand the OrderItemType and answer the following question: What is mthe
type for the price element? l ฺ o
c ideฺ
i
a Gu
d) Expand the PurchaseOrderType complex type and answer g m t
the following
questions: o @ e n
r c ad Stud
i) What are the type and values for the payOption
ฺ m e thiselement?
ii) What are the name and type m ofin se element?
the repeating
z u
jathe internalorder.xsd,
to
3) To compare the po.xsd with
k a ฺ e open both files and
r i n s
answer the following
o (eXML
questions:e
ic files at the same time, JDeveloper allows you to
lschema
Hints: To view d both l e
rearrange
e rcthea XSD e r b side-by-side (horizontally) or one above the other
awindows
M f
sneeded ask your instructor to demonstrate this capability.
r i ka(vertically).
-t r a n If
E a)onAssociate the first-level child elements of the PurchaseOrder element in the
n po.xsd with their corresponding “order” elements in the
internalorder.xsd, and identify the differences in XML element names
and types (if any).
b) Expand the “items” element of the PurchaseOrder parent in the po.xsd, and the
corresponding “items” element of the “order” parent in the
internalorder.xsd, and describe the main differences.
c) Expand the OrderItemType complexType in the po.xsd and itemType
complexType in the internalorder.xsd and identify the differences in
XML element names and types.
d) Which element in the po.xsd is assigned the OrderItemType?
4) In JDeveloper, close the files application and remove from the IDE by performing
the following steps:
b) In the Confirm Close Application dialog box, accept the default “Close
application and remove it from IDE” option and click OK.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
5) In JDeveloper, close the
r a and
ikpo.xsd seinternalorder.xsd windows.
( e e n
d o l e lic
e rca erab
a M nsf
k
Eri on-tra
n
Step Answers
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
d o @ den
orderTotal
rca is Stu
Note: The payOptionType values are the same as the payMethodType values
e
i n ฺm e th
(as observed by the enumerated values in each schema). The same applies to
ฺ j a zm to us
the shipChoiceType and the shipMethodType definitions. If a single
e r ika ense
company is sharing these XSD definitions one could rearrange XML
elements definitions to share a consistent type definitions.
o ( lic
3b) d
The “items” element in the internalorder.xsd contains the additional
l e
e rca erab
child called inStock.
a M nsf
Note: The inStock element is used to track if all items for a given order are in
k
Eri on-trastock (value = true) so that an order can be fulfilled. If any item in the order
is not in stock (value = false) then the whole order is place in a “waiting”
n status until stock for the ordered items become available, in which case the
order is not fulfilled.
3c) The differences between type definition for the “item” elements are
represented in the following table:
In po.xsd OrderItemType In internalorder.xsd
itemType
Product_Id prodId
ProductName prodName
Quantity qty
itemTotal
Note: The itemTotal is used as a line item total that is used to simplify the
calculation of the orderTotal in the internalorder.xsd.
3d) The “item” child element of the items element in the PurchaseOrder.
2) In the Database Navigator, click the Expand (+) icon next to the soademo
connection.
Note: This action also opens a SQL Worksheet in a window named soademo, in
which you can enter and execute SQL statements.
3) Examine the CREDITCARDS database table structure and sample data by performing
the following steps:
a) In the Database Navigator, click the Expand (+) icon next to the Tables node a
b) Double-click the CREDITCARDS table. This expands the CREDITCARDS table h a s
entry and opens a tab page with a description of the columns. m )
l ฺ o
c ideฺ
c) On the CREDITCARDS page, click the Data subtab at the m i
a of G
bottom theuwindow
to view the data in the table. g
@ den t
d o
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k -trathe CREDITCARDS page, and soademo page.
Eri d)onClose
n
4) In the Database Navigator, right-click the soademo connection name, and select
Disconnect
5) Click the Application Navigator tab, and optionally close the Database Navigator.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
c. Create d o
SOA e lic Composite Template: Empty Composite
Application
l
e ca3 of r3ab
- rStep Click Finish.
M s f e
r i kaNote:-tUse
r anthe following screenshots as a guide for the corresponding steps in the
E table
non above.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
c) o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
3) The composite.xml file is opened, and select File > Save All to save the changes
to your Application and Project.
following table:
Step Screen/Page Description Choices or Values
a. Create Web Service Name: ReceivePO
Next to the WSDL URL field, click the
“Generate WSDL from schema(s)” icon ( ).
b. Create WSDL, on the Next to the URL field, click the “browse
Request tab schema file” icon ( ). The second of the two
icons. a
c. Type Chooser
Click the Import Schema ( ) icon. ) h
as
d. Import Schema File Click the Browse Resources icon.
l ฺ c om eฺ
e. SOA Resource Browser ai Gufolder
Locate the D:\labs\files\xsd
m id and
g OK.nt
select po.xsd, and click
@
f. Import Schema File With the po.xsd
a o u de click OK.
d filetselected,
g. Localize Files Copy e c
r Deselect
Options: s S the “Maintain original
ฺ m h i
t for imported files” option,
m indirectory
s e
u OK.
structure
c)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
d) e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
f) e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
ng)
i)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
j)
7) Select File > Save all to save the changes to the project. a
h a s
Create and Wire the Service Mediator Component m )
l ฺ o
c to the e ฺ
i
8) Create a Mediator component and wire the ReceivePO service entry
a Gu point i d
Mediator component, by performing the following steps: gm t
o @ e n
a) In the Composite Editor (composite.xml),adrag
r c S t ud component into
d a Mediator
the Components column.
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: The Mediator interface is defined by wiring the SOAP service to the
s a
Mediator component. The interfaces are implicit.
) h a
c) Create a wire from the ReceivePO exposed service icon to the RoutePO o m ฺ
Mediator
c iservice
icon, by dragging the right-edge arrow icon from the ReceivePO i
a Gul ฺ
exposed d e
to the left-edge arrow on the Mediator component. Use the g mfollowing t image as a
o @ e n
guide:
r c ad Stud
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
9)ka
M f
Select Filen>sSave, or click the Save All icon to save the changes to your application.
Eri on-tra
Create
n a File Adapter as an External Reference
You now create an external reference for the File Adapter to write the input message
structure to a file in the file system.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
a zm o us
11) In the composite.xml a ฺ j
window, drage ta File Adapter component from the
i k s
erto thelicExternal
Component Palette(on
o en References column.
r c ad able
a Me nsfer
k
Eri on-tra
n
12) On the Adapter Configuration Wizard pages, use instructions in the following table to
configure the File Adapter:
Step Screen/Page Description Choices or Values
a. Welcome Click Next.
b. Service Name Service Name: WritePOFileService
Click Next.
c. Adapter Interface Select the “Define from operation schema
(specified later)” option.
Click Next.
d. Operation Select the Write File option.
Click Next.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
b) e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d)
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
)h a
m
co ideฺ
i l ฺ
g ma t Gu
13) On the Adapter Configuration Wizard page, continue d o @ dethen File Adapter
to configure
WSDL interface by importing the internalorder.xsdrca is SXML tu schema and
selecting its “order” element, by performing
e
ฺm the efollowing
th steps:
i n
Step Screen/Page Descriptionj a zm Choices
t o us or Values
Messages rika
ฺ
a.
e e n se Click Browse for schema file icon.
b. Typeo (
Chooser lic Click the Import Schema ( ) icon.
d
a ab File l e
c.ercImport rSchema Click the Browse Resources icon.
a Md. nSOA s feResource Browser In the D:\labs\files\xsd folder select
k
Eri on-tra internalorder.xsd, and click OK.
n e. Import Schema File With the internalorder.xsd file selected, click
OK.
f. Localize Files Copy Options: Deselect the “Maintain original
directory structure for imported files” check box, and
click OK.
g. Type Chooser Expand the Project Schema Files >
internalorder.xsd entry (if needed), select
order, and click OK.
h. Messages Click Next.
i. Finish Click Finish.
Note: If you require help to perform this task, use the following screenshots as a
guide for the steps in the preceding table:
s a
) h a
o m
c ideฺ
i l ฺ
b)
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
c)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
e)
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
f) M
a n s f
k
Eri on-tra
n
s a
h)
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
i)
14) In the composite.xml file window, verify the File Adapter icon has been added to
External References column.
16) Select File > Save All to save the changes to your project, and verify that your
composite application matches the following diagram:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: The XML namespace prefixes shown in the XML editor may differ from those
shown in the screenshots.
To perform this task use instructions in the following table:
Step Screen/Page Description Choices or Values
a. PurchaseOrder_To_order.xsl Drag the PurchaseOrder element in
the source column and drop it onto
the order element in the “XSLT File:
WritePOFileService.wsdl” column.
b. Auto Map Preferences Click Show Dictionaries.
s a
c. Auto Map Preferences h a
Under Dictionaries field, Click Add.
)
d. Open Navigate to folder o m
c ideฺ
i l ฺ
D:\labs\files\xml, and select
g ma t Gu
the file Order-Dictionary.xml
Click Open.
d o @ den
e. Auto Map Preferences rca is Stu
Click OK to perform the automatic
e
i n ฺm e th
mapping operation with the
ฺ j a zm to us
dictionary applied.
a)
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
c)
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
e)
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
Note: At this time, there areฺnoj a zm elements
source t o us that directly map to the orderPrice,
a > itemTotals
items > inStock, itemsr>ikitem se elements in the “XSLT File:
( e e n
WritePOFileService.wsdl”
d o e ic Mappings for these elements are done in a
lcolumn.
subsequentcapractice.
rbecause a l
The
b “for-each” construct is automatically inserted for the “item”
e
element r
M nsfe a repeating element.
it is
a
k -the
Er6)i Click
n traRoutePO.mplan window, and confirm that the Transform Using field
o the new mapping file. Use the following screenshot as a guide:
nshows
7) Select File > Save All to save the changes to all files in the project. You can also
close the PurchaseOrder_To_order.xsl window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
3) Since this is the o ( licare deploying an application in your JDeveloper
first time you
d l
caAuthorization e
session, rthe
e f e r ab Request window is displayed. Enter weblogic
M
in the Username field, welcome1 in the Password field, and click OK.
r i ka -trans
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
Test POProcessing using Enterprise Manager d o @ en
WebuInterface
d
In this section you use a Web browser to access e therc
a Enterprise
Oracleis St Manager 11g
Fusion Middleware Control and initiate ain ฺmof theedeployed
test th POProcessing application.
5) Log in to Oracle Enterprise Managerj a us Middleware Control application and
zm 11gtoFusion
a ฺ e following steps:
open a Web browser by
e r ikperforming
e n sthe
a) In the Web o ( window,
browser lic enter the URL http://localhost:7001/em.
d
a ab l e
rcOracle
b) Onethe erEnterprise Manager 11g Fusion Middleware Control login page,
a M s f
r i k -tran
enter the User Name weblogic, and Password welcome1, and click Login.
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
7) On the Test Web Service page, scroll down to the Input o @Arguments
d e n to the
section
d
ca XML
Request tab, select XML View and replace therinitial tu with the XML
contents
e S
i n ฺ m e this
data in the file D:\labs\files\xml_in\po-medium-ipod.xml. If you
require help to replace the initial XML
m text, use
s the following steps (or similar):
a z
j > Open o u
tand browse to the
a) With JDeveloper, select
k a ฺFile e
i s
er licenfolder, select po-medium-ipod.xml and select
D:\labs\files\xml_in
Open. o (
r c ad able
b) M
a
In e er po-medium-ipod.xml window, press Ctrl +A to select all
the JDeveloper
s f
k the text,nand press Ctrl + C to copy the selection to the clipboard.
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
rcapage,
d) On the “POProcessing [1.0]” Test Web Service S tuTest Web Service.
Click
e
ฺm e this
i n
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: This action sends the XML data as input message to the POProcessing
composite application. It might take several seconds for the page to refresh with
the response displayed in the Response tab. Please wait until the page is refreshed.
If you see the above error dialog box, then perform the following steps to correct and
s a
resubmit the data:
) h a
i) On the “Input arguments validation failed” dialog box, click OK. o m
c ideฺ
i l ฺ
ii) On the Request tab, in Input Arguments section modify g mthea contents
t G uof XML
View field based on the following options: o@
d e n
d
caend sof all u XML data, delete
tthe
(1) If there is extra space or lines atrthe
e S
those spaces and lines ensuring
i n ฺm thee XMLthi data is unaffected, and click
Test Web Service, or
ฺ j a zm to us
aextra space
(2) If there isikno
r e or lines at the end of all the XML data, put
spointer
( e
the cursor or e
mouse
c n after the last character on the last line of
o l i
r c ad able
the XML data, press Enter, and click Test Web Service
a M s f er the rest of the course you may have to repeat this process as
e Throughout
Note:
k required nwhen submitting XML data to initiate tests for each composite
-tra
Eri onapplication.
n
8) On the “POProcessing [1.0]” Response tab page, click the Launch Message Flow
Trace link to view the results of the asynchronous composite application.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den folder and
10) In a Windows Explorer window, navigate to the D:\labs\podata
examine the XML file created for the order. erc
a S tu
i n ฺ m e this
a) Ensure that the order_1.xml mfile has been
s created in the podata subfolder, as
a z o u
k a ฺj
shown in the following image:
e t
i s
o (er licen
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
In e
c) M
rca erabwindow, close the order_1.xml and the po-medium-
the JDeveloper
a n s f
k windows.
Eri on-tra
ipod.xml
The goal of this practice is to explore Oracle Enterprise Manager Fusion Middleware
Control interface for managing an SOA composite application. Your tasks are to:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
You also test the changes to the deployed application and verify that an order data file is
created in the new physical directory applied by the configuration plan.
directory, and deploy the application using JDeveloper and test the order is written to a
file in the labs directory.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
g. Adapter Configuration Wizard e rcaNext.is Stu
Click
Step 6 of 7 – Messages i n ฺm e th
h. Adapter Configurationja zm to uClick
Wizard
s Finish.
ฺ
e r ika ense
Step 7 of 7 – Finish
o
3) To set the path value ( for theliorderfiles
c logical name perform the following steps:
a d l e
M therc
a) In e rab
composite.xml
f e window, click the WritePOFileService external
i ka reference
a s
n icon ensure that the File Adapter reference is selected.
r t r
E b)onIn- the Property Inspector for the Reference – WritePOFileService (in the lower
n right pane in the JDeveloper window), observe that JDeveloper has added a File
Adapter reference property called orderfiles for the logical name.
the property.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e r ca s Stu
4) Select File > Save All to save the changes
i n thi
ฺmto theeapplication.
Deploy the Modified POProcessing j a us
zm toComposite Application
a ฺ e
5) In the JDeveloper window,
( e rik deploy
e nsthe modified POProcessing project by performing
the following d o le li
steps: c
a
c rabNavigator, right-click POProcessing project name, and select
a) In ether Application
a M fe
Deployn>sPOProcessing > to > soaserver
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
c) In the Log window, observe
a thesloge messages to ensure that deployment is
successful. r i k n
o (e lice
r c
Test the Modifiedad aPOProcessing
b le Composite Application
M e fer
6)ka
i a n s window, enter the Enterprise Manager URL
In a Web browser
r -t r
E http://localhost:7001/em,
n and login as weblogic with password
o
nwelcome1.
7) On the Enterprise Manager home page, locate and click the “POProcessing [1.0]” link
under the Farm SOA > soa-infra folder.
8) On the “POProcessing [1.0]” page, click Test.
9) On the “POProcessing [1.0]” Test Web Service page on the Request tab perform the
following steps:
a) In the Input Arguments section, in Tree View mode enter the following values:
custID: 1
ID: 2
payOption: credit
shipChoice: two_day
status: Initial
ccType: AMEX
ccNumber: 1111-2222-3333-4444
s a
) h a
o m
c ideฺ
i l ฺ
andain the item
b) While still in the Tree View mode, expand the items field,m u field (as
shown above) enter the value 1 in the OrderItemTypeArrayg t G
nand click the
d o @ dSize, e
rca is Stu
document icon.
e
ฺm e th
i n
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
c) Expand the OrderItemTypeArray item and the OrderItemType item and enter the
following field values, and then click Test Web Service.
productId: SKU102
productName: Test Product
price: 100
quantity: 1
10) On the “POProcessing [1.0]” Response tab page, click the Launch Message Flow
Trace link.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
11) On the Flow Trace page, verify that the
i n ฺm e th composite application instance
POProcessing
ฺ j a zm to us
completed all processing successfully.
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
2) In the e rca erConfiguration
Composite ab Plan Generator dialog box, accept the default plan
a M s f
kfile name, nand click OK.
Eri on-tra
n
Note: The configuration plan file is generated into the project folder, and JDeveloper
opens the POProcessing_cfgplan.xml file in its own window.
3) In the POProcessing_cfgplan.xml window, scroll down until you locate the
<reference name="WritePOFileService"> element, and append the text
\podata to the value D:\labs contained in the <replace> element. The
resulting <replace> element should be as follows:
s a
) h a
o m
c ideฺ
i l ฺ
4) Select File > Save All to save the changes to the project files. ma G u
@ deng t
Validate the Configuration Plan d o
e r ca s Stu
5) On the Application Navigator, right-click
i n ฺ m e t hi
the composite.xml file and select
Validate Config Plan.
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
7) In the POProcessing_cfgplan_report.log window, verify that the) h a
orderfiles Reference Property is replaced with the new value of ฺco
m ฺ
D:\labs\podata specified in the configuration plan beingm
l de
ai GUseuithe
validated.
following image as a guide: @ g nt
a d o t u de
e r c s S
m h i
m inฺ use t
ฺ j a z to
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
b) ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri c)on-tra
n
e)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
f)
2) After the redeploy processing window is displayed and closed when the deployment
successfully completes, click “POProcessing [1.0]” link in the Farm navigator tree to
view the home page (if needed), and click the Show XML Definition icon.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
3) In the Definition window, locate the XML
i n ฺm<property>
e th element with the
name="orderfiles" attribute,
j a o usthat the value is D:\labs\podata,
zmand tverify
k ฺ
as expected due to redeployment
a with ethe configuration plan. Then click OK to close
the window. r i n s
o (e lice
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
j a us
zm to composite
5) After verifying that the new POProcessing application instance completed
successfully in the Flowik ฺ
a page,seuse Windows Explorer to verify that the
Trace
order_1.xml file ( e r
has been en with supplied data in the D:\labs\podata
created
o l i c
folder.
r c ad able
a Me nsfer
k
Eri on-tra
n
Note: There is a chance that more than one XML file may exist in the podata
subfolder. If that is the case, then the file with the highest sequence number contains
the latest order information.
The goal of this practice is to create the CreditCardValidation composite application that
receives a credit card number and the purchase order total. The CreditCardValidation
composite application validates the credit card using a Database Adapter service, which
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
queries the CREDITCARDS table in an Oracle Database instance. Your tasks are to:
• Create a new SOA project for the CreditCardValidation composite application,
using a Mediator component whose WSDL interface is based on the
creditcheck.xsd schema elements
• Add and configure a Database Adapter into the composite application that
performs a Select operation on the CREDITCARDS table to return the status and
limit information for the given credit card number.
• Deploy and test the composite application
s
The following image represents the composite application design for your
a
CreditCardValidation project: ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
the Application menu, click the Application Menu icon and select New Project.
2) In the New Gallery window, select the SOA Project in the Items list of the Project a
category, and click OK. h a s
3) In the “Create SOA Project – Step 1 of 2” Project Name window, enter o them
)
Projectฺ
Name: CreditCardValidation, and click Next. a ilฺc uide
4) In the “Create SOA Project – Step 2 of 2” Configure SOA @ gm window,
Settings n t G select the
Composite With Mediator for the Composite Template
a declick Finish.
dooption,tuand
e r c s S
m h i
m inฺ use t
ฺ j a z to
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
click the “Generate WSDL from Schema(s).” icon (next to the WSDL URL field).
For example:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nNote: The Create WSDL window is opened.
Define the Mediator WSDL Interface
6) To define the Request message for the Mediator component WSDL interface, use
instructions in the following table as a guide (and use associated screenshots after the
table):
Step Screen/Page Description Choices or Values
a. Create WSDL > Request Click the Browse icon next to the URL field.
b. Type Chooser Click the Import Schema icon.
c. Import Schema File Click the Browse icon.
d. SOA Resource Browser Using the File System option, locate and
select the creditcheck.xsd in the
D:\labs\files\xsd folder, and click
OK.
c)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
d) i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
f)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
g) e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
o@ message d e n
7) On the Create WSDL > Reply tab page, to define a
c d
the Reply
tufollowing structure for the
e r
Mediator component WSDL interface, use instructions
i in
s S
the table as a
guide: m
inฺ use t h
a m
z Choices
Step Screen/Page Description
a ฺ j e totheorBrowse
Values
a.
e k
Create WSDL >riReply
n sClick icon next to the URL field.
b. (
Type Chooser
o e
lic Expand the Project Schema Files >
d l e
e rca erab creditcheck.xsd nodes (if needed) and
select the CreditCheckResponse element, and
a M nsf
k ra WSDL click OK.
Eri oc. n-tCreate Click the Fault tab.
na)
s a
) h a
o m
c ideฺ
i l ฺ
c)
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
8) On the Create WSDL > Fault tab page, to define the Fault message structure for the
Mediator component WSDL interface, use instructions in the following table as a
guide:
Step Screen/Page Description Choices or Values
a. Create WSDL > Fault Click the Browse icon next to the URL field.
b. Type Chooser Expand the Project Schema Files >
creditcheck.xsd nodes (if needed) and
select the CreditCheckFault element, and click
OK.
c. Create WSDL Click OK.
s a
) h a
b) o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
c)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca istab.
10) In the JDeveloper window, click the composite.xml Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a n s f
M composite.xml
11) In the window, verify you initial composite assembly model
k trathe following image:
Eri resembles
n -
no
12) Select File > Save All to save your changes to the composite application project.
s a
) h a
2) To configure the Database Adapter with the Adapter Configuration Wizard the
following instructions: o m
c ideฺ
i
a Gul ฺ
a) Adapter Configuration Wizard – Welcome, click Next. gm t
Step Screen/Page Description o @
Choices ordValues ud e n
b. Adapter Configuration Wizard Service
a CreditCardDBService
rcName: S t
– Service Name
e
m Next.
ฺClick this
i n e
c. Adapter Configuration Wizard
j a zm toClick usthe Browse (flashlight) icon next to
– Service Connection
k a ฺ e the connection field.
d. r i
e lice
Select IDE Database n s Select the soademo entry, and click Copy
Connectiono ( Connection.
d ble
e. e rca eConfiguration
Adapter r a Wizard Observe the JNDI Name has the value
M f
ns Configuration
r i kaf. -t–Adapter
r
Service
a
Connection eis/DB/soademo, and click Next.
E on – Operation Type Wizard Select option,
the “Perform an operation on a Table”
and ensure the Select check box is
n selected, and deselect other operations.
Click Next.
g. Adapter Configuration Wizard Click Import Tables.
– Select Table
h. Import Tables Click Query.
i. Import Tables Copy the CREDITCARDS table from the
Available list to the Selected list, click OK.
j. Adapter Configuration Wizard With the CREDITCARDS table listed, click
– Select Table Next.
k. Adapter Configuration Wizard Click Next.
– Relationships
l. Adapter Configuration Wizard Select the creditLimit and status
– Attribute Filtering attribute options, deselect remaining options.
Note: The cardNumber (key attribute)
cannot be deselected.
Click Next.
c)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nd)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
f) d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
h)
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
j)
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
l) m
l ฺ o
c ideฺ
i
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
3) While still in the Adapter Configuration Wizard pages, configure the query
parameters and selection criteria by using the following table of instructions:
Step Screen/Page Description Choices or Values
a. Adapter Configuration Wizard Next to the Parameters section, click Add.
– Define Selection Criteria
b. Parameter Name Enter ccNum and click OK.
c. Adapter Configuration Wizard Next to the SQL field, click Edit.
– Define Selection Criteria
d. Expression Builder Click Add.
e. Expression Builder Form the condition:
cardNumber EQUAL ccNum, where:
First Argument Query Key: cardNumber
Click OK.
f. Adapter Configuration Wizard Verify your SQL statement is correct, and
– Define Selection Criteria click Next.
g. Adapter Configuration Wizard Click Next.
– Advanced Options
h. Adapter Configuration Wizard Click Finish.
– Finish
a)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nb)
s a
) h a
o m
c ideฺ
d) i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
f) e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
h) g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
Wire
n the Mediator to the DB Adapter and Create Transformations
4) In the composite.xml window, create a wire from the Mediator component to the
Database adapter External Reference by dragging the right-edge arrow of the
Mediator component to the left-edge arrow of the Database Adapter icon.
s a
a) In the Request Transformation Map window, click the Create New Mapper ) h a
File
option, accept the default file name supplied, and click OK. o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic map the CCNumber element in the Source column
b) In thec d
a ab
XSLT Mapper l ewindow,
r ccNum
a M nsferelement in the target column, as shown in the following image:
to e
the
k
Eri on-tra
n
s a
) h a
o m
cMapperidFileeฺ
a) In the Reply Transformation Map window, select the Create Newi l ฺ
g ma t Gu
option, accept the default file name supplied, and click OK.
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k raXSLT Mapper window, expand the source tree and map the status element
Eri b)onIn-tthe
n in the Source column to the status element in the target column.
10) In the JDeveloper window, close the XSLT Mapper and the
ValidateCreditCard.mplan windows.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
a M nsf
k
Eri on-tra
n
3) To perform a second test, to enter another request click the Request tab.
a) On the Request tab page, modify the CCNumber value to be 4321-4321-
s a
4321-4321, leave the amount at 1000, and click Test Web Service.
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e r a asershown
b) On thecResponse
INVALID,
a btab page, verify that the status string value returned is
in the following image:
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
As a result you learn how to: g ma t Gu
• Manage service virtualization and how to restructure o @ e
a composite
d nassembly model
with a new Mediator component and makerchanges
d
ca sto S thetu
component wires
without affecting the exposed serviceฺm e i
(external tclient
h interface)
• Modify the XSL transformation, i n
between e
m o us and second Mediator
the first
components, to calculateฺthe a z
j itemetotals.
t In this case, you reuse and modify the
i k a
existing XSL Transformation. s
• Create a newoXSL (erTransformation,
l i c en in the routing rule between the second
c
Mediator
d the bWritePOFileService,
aand le to calculate the order total using the item
e r r a
a M n s fecalculated by the XSL transformation between the Mediator
totals already
i k traare multiple solutions for calculating the item and order totals. One solution
components.
ErNote: n -
There
nothat uses a single XSL file without the need for an additional Mediator component.
exists
However, the single XSL file approach involves a higher degree of complexity and a
detailed knowledge of XSL constructs, which can only be coded in the XSLT Mapper
source and not visually constructed. Since the detailed explanation of the XSL constructs
involved (call-template and recursion) is not in the scope of this course, the design
approach used was chosen for its simplicity and the ability to provide a context in which
you can learn to use the various capabilities in the composite application assembly model
and work with additional XSL functions visually.
Note: Deleting a routing rule from a Mediator component deletes the associated
wire from the composite.xml file. However, deleting the wire from the
composite.xml removes the target service from the associated Mediator s a
) h a
routing rule, that is, a routing rule is not deleted when its associated wire is
deleted. o m
c ideฺ
i l ฺ
d) In the Confirm Delete dialog box, click Yes. g ma t Gu
o
e) In the JDeveloper window, click the composite.xml
@ tabdand
e nverify that the
d tu removed. Use the
rca ishasSbeen
wire between the RoutePO and WritePOFileService
e
following image as a guide:
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n and Wire a new Mediator Component between RoutePO and
Insert
WritePOFileService
3) In the composite.xml window, create a new Mediator component called
EnrichPO using the One-Way Interface template, and set the Input (type) as the
order element in the internalorder.xsd project XML Schema.
Note: Ensure the “Create Composite Service with SOAP Bindings” check box is
deselected.
If you require help to perform this task, use the table of instructions and associated
screenshots:
Step Screen/Page Description Choices or Values
a. composite.xml Drag a Mediator component from the component
palette into the Components column.
b. Create Mediator Name: EnrichPO
Template: One-Way Interface
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
b)
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
d)
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
4) In the composite.xml window, create two wires to form the next phase of the
composite application assembly model, using the following image as a guide:
Note: If you require help to perform this task, use the following steps to accomplish
the task:
s a
) h a
o m
cMediator ฺ
b) In the composite.xml window, drag a wire from the EnrichPO i
a Gul ฺ i d e
“Drag to add a new Reference” icon ( ) to the service g m
interfacenicont ( ) of the
o @ e
WritePOFileService external reference.
r c ad Stud
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
5) aIn the n f window, select File > Save All to save the changes to all files in the
M JDeveloper
s
k tra
Eri project.
n -
no
from the item totals before the transformed data is sent to other services, such as the
WritePOFileService.
f) In the RoutePO.mplan window, confirm your changes to the XSL mapper file
have been applied, and select File > Save to save the changes.
2) Close the RoutePO.mplan window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
c)
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nd)
e r ika ense
a) o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
b)
c)
calculated. You create a new XSL file to calculate the orderTotal from the sum of all the
itemTotal elements.
1) To create a new XSL file for the routing rule to the WritePOFileService that
calculates the sum of all itemTotal elements to the orderTotal, perform the following
steps:
a) In the composite.xml window, double-click the EnrichPO Mediator
component to open the Mediator Editor.
b) In the EnrichPO.mplan window, under the Routing Rules section in the Static s a
h a
Routing for the execute operation, click the “Select an existing mapper file or
)
create a new one.” Icon ( ). o m
c ideฺ
i l ฺ
maNewt Mapper
c) In the Request Transformation Map window, select the Create
g G u File
d o @ den and click
option, accept the default XSL file name order_To_order.xsl,
OK.
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n Note: The order_To_order.xsl file is opened in the XSLT Mapper visual
design window.
2) In the order_To_order.xsl window, to map all elements in the source to their
corresponding elements in the target, perform the following steps:
a) Click and drag a line connecting the order element in the source column to the
order in the target column.
b) In the Auto Map Preferences window, accept the default settings and click OK.
c) In the order_To_order.xsl window, verify that all the elements have been
mapped by expanding all the child nodes.
a) Delete the map line between the orderTotal elements, by clicking the line
connection the orderTotal elements and pressing Delete.
b) Drag the sum function, from the Mathematical Function on the Component
Palette, into the middle column of the order_To_order.xsl window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
ฺm thee items
c) Drag a line from the itemTotal (expanding
i n th > item element, if required)
j a zm handle
from the source on to the left-side
t o uofs the sum function in the middle
column. ฺ
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
d) Drag a line from the right-side handle of the sum function to the orderTotal
element in the target column.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
b)
s a
) h a
o m
c ideฺ
c) i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th file has been created with
5) In Windows Explorer, verify that the order_2.xml
supplied data in the D:\labs\podata
j a us
zm tofolder.
ฺ
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
nNote: There is a chance that more than one XML file may exist in the podata
subfolder. If that is the case, then the file with the highest sequence number contains
the latest order information.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
7) In JDeveloper, close the order_2.xml window.
The goal of the practices for this lesson is to modify the POProcessing composite
application assembly model by adding two BPEL Process components to perform order-
processing tasks. The following image shows the assembly model changes:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
rca istwoStBPEL
After modifying the assembly model you edit the following
u process
components and create their structure with their
e
ฺm initial th Assign, and Transform
Scope,
activities: i n
m o us e
1. The ApproveCCOrder BPEL ฺ j a zprocess
t that validates the credit card and is later
k a workflow
modified to includerihuman s e to manually approve orders if their total
( e c e n
exceeds 3000.
a d o le li
c raBPEL
2. The Fulfillment
e r b process that performs processing tasks to fulfill approved
a n s fe processing includes checking if stock (inventory) for the order
orders. Fulfillment
M
k -tra forfrom
Eri onproducts
is available an internal and online store, selecting the store to supply the
an order, and sending the order to a shipping company.
n
The tasks required to change the assembly model include:
• Adding the two BPEL components
• Adding the wires between components, and modifying the EnrichPO Mediator
component with routing rules that use filters to route paypal orders to the
WritePOFileService and Fulfillment BPEL process, and credit orders to the
ApproveCCOrder BPEL process.
• Adding a wire from the ApproveCCOrder BPEL process to the Fulfillment BPEL
process to ensure credit card orders that are approved are fulfilled.
s a
) h a
o m
c ideฺ
To complete these tasks perform the following steps: i l ฺ
g ma project
1) In the JDeveloper Application Navigator, expand the POProcessing t G uand
double-click the composite.xml file under the SOA o @ e n
Contentdfolder.
d tuperform this step.
ca yousdoSnot
Note: If the composite.xml file is already e ropen
2) In the composite.xml window, toin ฺma neweBPEL
add thi component, drag the BPEL
Process icon from the Component
j a zm
Palette
t o usthe Components column.
into
ฺ
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
3) In the Create BPEL Process window, configure the BPEL Process by using
instructions in the following table and associated screenshots:
Step Screen/Page Choices or Values
Description
a. Create BPEL Name: ApproveCCOrder
Process Deselect the “Expose as a SOAP service” check box
Accept default values for other fields.
Next to the Input field, click the Browse Input Elements icon
( ).
c. Create BPEL Next to the Output field, click the “Browse Output
Process Elements” icon ( ).
d. Type Chooser Expand the Project Schema Files >
internalorder.xsd, select order and click OK.
e. Create BPEL Verify that the Template is set to Asynchronous BPEL
Process Process, that the Input and Output elements have
{http://www.example.org/ns/intorder}order
as their value, and that the “Expose as a SOAP service”
option is not selected, and click OK.
s a
a) ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
c) i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
e) i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
5) Verify that your composite.xml assembly model resembles the following image:
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
6) Click File > Save All to save a changes eto all files in the POProcessing project.
r i k n s
Add the Fulfillment o (eBPEL l i c e
Component
r
In this section,c ayoud addathe
b e
lFulfillment BPEL Process component to the composite
M eassembly f e r
application
i k a a n s model, and create wires from the EnrichPO Mediator component
r
E and r
-timage as a guide:BPEL process to the Fulfillment BPEL process. Use the
the ApproveCCOrders
n
o
following
n
To complete these changes to the assembly model, perform the following steps:
7) In the composite.xml window, to add a new BPEL component drag the BPEL
Process icon from the Component Palette into the Components column.
8) In the Create BPEL Process window, configure the following field values:
Name: Fulfillment
Output: {http://www.example.org/ns/fulfillment}Fulfill
mentResponse
Accept default values for all the other fields.
Note: To set the Input and Output elements use their respective browse icons, and
import the D:\labs\files\xsd\fulfillment.xsd the first time you browse
for an element. Use the following screenshot as a guide for the Create BPEL Process
configuration:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: Only if you require help to perform this task, use instructions in the following
table (without associated screenshots) to configure fields in the Create BPEL Process
window:
Step Screen/Page Description Choices or Values
a. Create BPEL Process Name: Fulfillment
Deselect the “Expose as a SOAP service”
check box
Input: Click the Browse Input Elements icon
( ).
b. Type Chooser
Click the Import Schema File icon ( ).
c. Import Schema File Click the Browse Resources icon ( ).
10) To create a wire from the EnrichPO Mediator component to the Fulfillment BPEL
s a
) h a
component, click and drag the “Drag to add a new Reference” icon ( ) from the
right edge of the EnrichPO Mediator component to the left edge service interface icon
m
l ฺ o
c ideฺ
( ) of the Fulfillment BPEL component. i
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
i k traa wire from the ApproveCCOrder BPEL component to the Fulfillment
Er11) Ton -
create
o component, click and drag the “Drag to add a new Reference” icon ( ) from
nBPEL
the right edge of the ApproveCCOrder BPEL component to the left edge service
interface icon ( ) of the Fulfillment BPEL component.
13) Click File > Save All to save changes to all files in the POProcessing project.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
b)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
3) On the JDeveloper menu, click File > Save All, or click the Save All icon ( )on the
JDeveloper toolbar.
Add a Credit Filter and Reuse an XSL file in the Second Routing Rule
4) In the EnrichPO.mplan window, in the second routing rule (with the
ApproveCCOrder/approveccorder_client::process target service) add a filter that
checks if the input message payMethod element is equal to the 'credit' string
value. Use the following substeps:
a) In the EnrichPO.mplan window, in the routing rule with the
ApproveCCOrder/approveccorder_client::process target service, click the Invoke
Expression Builder icon ( ).
b) In the Expression Builder window, in the Variables section, expand the in >
request > order tree, select payMethod, and click Insert Into Expression.
Click OK.
5) In the EnrichPO.mplan window, in the second routing rule (with the
ApproveCCOrder/approveccorder_client::process target service) add an XSL
Transformation. Use the following substeps:
a) In the EnrichPO.mplan window, in the routing rule with the
ApproveCCOrder/approveccorder_client::process target service, click the “Select
an existing mapper file or create a new one.” icon ( ).
b) In the Request Transformation Map window, use the Use Existing Mapper File s a
option (the default), and click the Browse Mappings icon ( ). ) h a
o m
c idefileฺ
i l ฺ
c) In the SOA Resource Browser window, select the order_To_order.xsl
from the project XSL folder, and click OK.
g ma t Gu
d) In the Request Transformation Map window, with othe d n Mapper File
@Use Existing
e
d
a OK.Stu
field set to xsl/order_To_order.xsl,
e rcclick
i n ฺm e this
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: In this case, we are using an existing XSL file because it meets with the
requirements for this routing rule source and target element structures.
6) On the JDeveloper menu click File > Save All, or click the Save All icon ( ) on the
JDeveloper toolbar.
Add a PayPal Filter and New XSL File to the Third Routing Rule
7) In the EnrichPO.mplan window, in the third (and last) routing rule (with the
Fulfillment/fulfillment_client::process target service) add a filter that checks if the
input message payMethod element is equal to the 'paypal' string value. Use the
following substeps:
a) In the EnrichPO.mplan window, in the routing rule with the
Fulfillment/fulfillment_client::process target service, click the Invoke Expression
Builder icon ( ).
similar):
$in.request/inp1:order/inp1:payMethod = 'paypal'
Click OK.
8) In the EnrichPO.mplan window, add a new XSL Transformation to the third
routing rule with Fulfillment/fulfillment_client::process as its target service. Use the
following substeps:
a) In the EnrichPO.mplan window, in the routing rule for
Fulfillment/fulfillment_client::process, click the “Select an existing mapper file or a
create a new one.” icon ( ). h a s
m )
b) In the Request Transformation Map window, select the Create New l ฺ o
c Mapper ฺ
File
e
option, and accept the default Mapper File Name
i
a Gu i d
order_To_FulFillmentRequest.xsl and click g m
OK. nt
o @
d window, demap all elements
c) In the order_To_FulFillmentRequest.xsl r c a S t u
by dragging the order element from ฺ m e
the sourcesh i s
t on to the
tree
FulfillmentRequest element i n
m o us tree.
in the e
target
a z
ฺj acceptealltthe default settings and click OK.
d) In the Auto Map window,
r i k a s
( e c e n
a d o le li
e) In the order_To_FulFillmentRequest.xsl window, delete the map line
e rc erab
connecting the orderTotal elements.
M s f
f) In the order_To_FulFillmentRequest.xsl
a n window, to calculate the
r i k -t r a
E onorderTotal correctly, perform the following mapping actions:
n i) Drag a Sum function from the Mathematical Functions group in the
Component Palette into the middle column of the window.
ii) Expand the source tree until you see the itemTotal, in the items > item child
nodes, and drag the itemTotal to the left-side handle on the Sum function in
the middle column.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ikato savee n setransformation map file and
o (
g) Select File > Save All the
licchanges.
d
EnrichPO.mplan
ca rab l efile
e r
9) Close
a n s fe
Mthe EnrichPO.mplan and order_To_FulFillmentRequest.xsl
k tra
Eri windows.
n -
no
The following image represents the BPEL process flow diagram you create in this
practice:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
To create the process flow shown requires that you perform the following tasks:
• Create an Assign activity to copy the received order data into the process output
variable. The output variable is used as working copy of data that is updated with
changes to the order as it flows through the process.
• Create the validatecc Scope to contain activities that interact with the credit card
validation composite application service. Initially this scope contains an Empty
activity.
• Create the fulfillment Scope to contain activities that interact with the Fulfillment
BPEL process. In this scope you create local BPEL variables used to interact with
structural design with the visual designers, and fill in the implementation details later.
However, you continue to develop and deploy other smaller composite applications, such
as the CreditCardValidation composite application, and Web services that are required as
external service to complete the POProcessing application. In addition, because the next
lesson teaches how to invoke other services from a BPEL process, you do not implement
activities to invoke external services from BPEL in this practice. Invoking other services
from BPEL is covered in the lesson titled “Orchestrating Services with BPEL” and its
associated practices.
Additional Note: You can use either of the following ways to rename BPEL activities: s a
• Double-click the activity name, enter the new name, and press Enter. ) h a
o m
c ideฺ
• Double-click the activity icon, replace the name in the General tab, and click OK.
i l ฺ
out the specific steps to rename an activity. g ma t Gu
For brevity, subsequent instructions just ask you to rename the activity and do not spell
d o @ den
To create the initial ApproveCCOrder BPEL process e Stu the following steps:
rcaflow,isperform
i n ฺm e th
Create and Name the Flow Activities
ฺ j a zm to us
ikaiconetonopen
1) In the POProcessing composite.xml
e r se window, double-click the ApproveCCOrder
o (
BPEL Process component
l i c the BPEL Editor.
c ad able
2) In the ApproveCCOrder.bpel
r window, create and name the three activities
e
M in the
shown
r
fe image:
following
k a n s
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
a renameStituto Assign_orderinfo.
rcand
b) Double-click the name of the assign activity
e
ฺm e this
i n
ฺ j a zm to us
e r ika ense
o ( lic
d
ca rab l e
e r
c) M
a
Drag a Scope
n s fe activity from the Component Palette into the flow after the assign
k activity.
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
e) Drag another Scope activity from the Component o @ intodthe
Palette e nflow after the
d
Scope_validatecc activity.
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
3) Select File > Save to save the changes to the ApproveCCOrder BPEL Process. m
l ฺ o
c ideฺ
i
Configure the Assign_orderinfo Activity
g ma t Gu
In this section, you edit the Assign activity and create a copy@
o operationeto
d n store a working
d
rca is Stu
copy of the order from the inputVariable in the outputVariable.
e
4) In the ApproveCCOrder.bpel window,
i n ฺm to edit
e h activity and add copy
tthe
a zm tthe
operations double-click the Assign_orderinfo
Note: Alternatively, you canฺjright-click o usactivity.
Assign_orderinfo activity and select Edit.
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: Editing an Assign activity causes the Copy Operation tabbed page of the
Assign activity to be displayed.
5) In the Assign window, create a copy operation that copies the order XML structure
from the (global) inputVariable to the outputVariable. Use instructions in the
following table and associated screenshots as a guide:
Step Screen/Page Description Choices or Values
a. Assign > Copy Operation
Click the Add icon ( ) and select Copy
Operation.
Click OK.
d o @ den
a)
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e
Note: When you select an element in a variable Stu you are creating an
rca treeisstructure
XPath expression for that elementin ฺmis added
that e ttohthe BPEL source code in the
j a t o usvalues. The XPath expression helps the
zm attribute
associated activity XML element
BPEL Engine extractkthe ฺ
a XMLsfragment
e or value and copy it to the target
r i n
element.
o (e lice
c)
r c ad able
a Me nsfer
k
Eri on-tra
n
6) Select File > Save to save the changes to the ApproveCCOrder BPEL Process.
8) Drag an Empty activity from the Component Palette into the Scope_validatecc
activity, and drop it on to the text Drop Activity Here within the expanded scope. a
h a s
m )
l ฺ o
c ideฺ
i
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
9) nConfirm that the scope contains the Empty_1 activity as shown in the following
image, and to collapse the Scope_validatecc activity, click its Collapse icon ( ).
s a
) h a
b) o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
d)
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
15) In the Variables window, create the fulfillmentResponse variable and i l ฺ cset its type
i d etoฺ
the FulfillmenResponseMessage type defined in the project g ma t Gu
fulfillment.wsdl
file. Use instructions in the following table as guide (no o @
screenshots
d e nare provided):
d
Step Screen/Page Description rca is Stu
Choices oreValues
a. Variables Click
i n ฺmCreatee icon
the th ( ).
b. Create Variable
j a zName: t o us
m fulfillmentResponse
k ฺ
a Type: e Select the Message Type option and click the
r i n s
o (e lice Browse Message Types icon ( ).
c.
r c ad able
Type Chooser Expand the Message Types > Project WSDL Files >
e
M nsfe r Fulfillment.wsdl > Message Types folders,
k a select the FulfillmentResponseMessage,
Eri on-tra and click OK.
d.n Create Variable Confirm the following field settings:
Name: fulfillmentResponse
Type: Select the Message Type option
Message Type: (without the namespace)
FulfillmentResponseMessage.
Click OK.
s a
h a
)to have
Note: The fulfillmentRequest and fulfillmentResponse variables are defined o m
ilฺc ubecause
message structures compatible with the Fulfillment BPEL processainterface, i deฺ
their message types are obtained from the WSDL file created m the Fulfillment
gfor t G
@ n
BPEL Process component interface.
c a do tude
17) Select File > Save to save the changes to thee r S BPEL Process.
ApproveCCOrder
i s
m
inฺ use t h
Create a Transform Activityzin
a m the Scope_fulfillment
o Activity
a ฺ j
In this section you create a Transform t
e to copy the contents of the outputVariable
activity
r i k n s
(e locallicvariable.
into the fulfillmentRequest
o e Therefore the Transform activity must be
c d ble
added inside theascope to access the fulfillmentRequest variable.
r
feraby mapping the parent elements and using the Automap tool to
Note: Thee children elements of each variable are the same; therefore, the transformation
mapais M s
quicklyncreated
ik -the
Ercomplete traXSL mapping required.
o n
18)nIn the ApproveCCOrder.bpel window, create and edit a Transform activity
inside the Scope_fulfillment activity. Use the following steps:
a) Drag a Transform activity from the Component Palette onto the text Drop Activity
Here in the expanded Scope_fulfillment activity.
19) Configure the transformation source variable as the outputVariable payload, and the
target variable as the fulfillmentRequest payload and create a new transformation a
a
map file called Transformation_to_fulfillment. Use instructions in the following table
h s
and associated screenshots as a guide: m )
l ฺ o
c ideฺ
Step Screen/Page Description Choices or Values i
a theG u
a. Transform > Transformation g mclick
Next to the Source section, t Create icon
( ). d o @ den
b. Source Variable rca Select
Source Variable: S tu
outputVariable
e this is already selected
ฺmPart:epayload
Source
i n
j a us
zmClicktoOK.
c.
k a ฺ
Transform > Transformation e Variable: fulfillmentRequest
Target
r i n s
o (e lice (should already be selected. If not select it)
M e fer
i ka -tran s xsl/Transformation_to_fulfillment
r
E on Click the Create Mapper File icon ( ).
n
Note: The XSL file is created and opened in the
XSLT Mapper Editor window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
b) d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
20) In the Transformation_to_fulfillment.xsl
r ca swindow,
S tu create the mappings
rules such that all elements in the source are
ฺ m e
mappedhtoi their respective target
t
elements by performing the followingm i n
steps: se
azsourcetcolumn
o u
a) Drag the order elementainฺjthe e to the FulfillmentRequest element in
the target column. r i k n s
o (e lice
r c adMapaPreferences
b) In the Auto
b le window, accept all default settings and click OK.
c) M e thatfeallr elements in the source are mapped to their respective elements in
Confirm
r i a a nsby expanding the child node. Use the following image as a guide:
k the-trtarget
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
22) In the JDeveloper window, closezthe
j a t o us
mApproveCCOrder.bpel window.
ฺ
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
implementation details later, after dependent services have been constructed. The
following image illustrates the initial structure of the Fulfillment BPEL Process
component:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: If you require help to perform this task, in the Fulfillment.bpel window
use the following steps:
s a
) h a
o m
c ideฺ
i l ฺ
7) Collapse each of the Scope activities and save the changes to your
g maproject. t G u
Add and Configure an Assign Activity in Scope_shiporder d o @ den
e
In this case, you initialize the response data in the
ca s Stuwith hard-coded string
routputVariable
m section
ฺThis i
thenables
that are later replaced with dynamic results.
m i n s e you to learn how to
create two copy operations in the same z Assign
ja e to u
activity.
a ฺ
8) In the Fulfillment.bpel
( e rik ewindow,
ns expand the Scope_shiporder, drag an Assign
activity into theo
d i c
scope, and lrename the Assign activity to Assign_shipstatus. Use the
a l e
M erc ferab
following image as a guide:
r i ka -trans
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
Note: If you require help to createin ฺmcopy operation,
the e th perform the following
steps:
ฺ j a zm to us
r a
ikCopy se tabbed page, click the Add icon ( ) and
i) On the Assign ( e > e n
Operations
select d o
Copy lic
Operation.
l e
ii) e rcthea Create
In e rabCopy Operation window, in the “From” section select
a M s f
k an
Expression
Eri on-trsingle
as the Type, and in Expression enter: 'none' (including the
quotes).
n iii) In the Create Copy Operation window, in the “To” section select Variable as
the Type, expand Process > Variables > ouputVariable > payload >
FulfillmentResponse and select shipStatus.
iv) Click OK.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
Note: If you require help to create the
i n ฺmcopy operation,
e th perform the following
steps:
ฺ j a zm to us
r>ik
a se tabbed page, click the Add icon ( ) and
i) On the Assign e
(Operation. e n
Copy Operations
select Copy
d o l e lic
rcthea Create
ii) eIn
e rabCopy Operation window, in the “From” section select
M s f as the Type, and in Expression enter: 'none' (including the
r i ka -trExpression
a n
single quotes).
E on
n iii) In the Create Copy Operation window, in the “To” section select Variable as
the Type, expand Process > Variables > ouputVariable > payload >
FulfillmentResponse and select carrier.
iv) Click OK.
s a
) h a
o m
c ideฺ
i l ฺ
ma t Gu window,
11) Collapse the Scope_shiporder activity, and close the Fulfillment.bpel
g
and save the changes to the POProcessing project. o@ d e n
d
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
that paypal orders are sent to the Fullfilment and WritePOFileService and not
processed by the ApproveCCOrder BPEL component.
• Test an order that uses the credit payment method, which is designed to check that
credit card orders flow through the ApproveCCOrder and Fulfillment BPEL
Process components and not the WritePOFileService.
In addition, you examine the results of executing Assign and Transform activities by
using Oracle Enterprise Manager to view BPEL component details in the Audit Trail and
Flow tabs of the Flow Trace page.
s a
To complete the testing tasks, perform the following steps:
) h a
1) Using JDeveloper, deploy the POProcessing project to the soaserveroconnection. m
c selectidtheeฺ
When the SOA Deployment Configuration Dialog window is displayed i
a Gul ฺ
“Overwrite any existing composites with the same revision ID.” g mcheck t box.
Note: Enter the login weblogic and welcome1 credentials @ n
o tuindane Authorization
c a d
Request window, if it is displayed. Monitor therMessages –SLog and Deployment -
Log windows to ensure the composite application ฺ m e isthsuccessfully
is deployed. If not,
i n e
ฺ j a zm to us
correct the errors and repeat this step.
2) Open a Web browser window,
r i k a and senter
e the Oracle Enterprise Manager URL
n
(e lice and if necessary login with Username:
http://localhost:7001/em,
weblogicawith o
d Password: le welcome1.
r c a b
3) OnM
a theeOracle s f er
Enterprise Manager home page, locate and click the deployed
k a n
Eri Farm
“POProcessing
r [1.0]” composite application link (located under the SOA tree in the
- t
non navigation pane).
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k Note: If you require help to perform this task, use the following substeps:
Eri a)onOn-trthea “POProcessing [1.0]” page, click Test.
n
b) On the Request tabbed page, in the Input Arguments section select XML View
and delete the supplied text.
c) Open the D:\labs\files\xml_in\po-small-guitar.xml in
JDeveloper (or Notepad) and copy all the text into the Input Arguments (XML
View) text area in the Web browser page.
d) In the XML View text area, replace the
<ns0:payOption>credit</ns0:payOption> element with
<ns0:payOption>paypal</ns0:payOption>.
e) Click Test Web Service.
6) On the Flow Trace page, under the Trace section confirm that the message flowed
through ReceivePO, RoutePO, EnrichPO and then to WritePOFileService and
Fulfillment. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
7) On the Flow Trace page, to examine
zlink s BPEL Process in the Audit Trail
mthe Fulfillment
uInstance
a ฺ
tabbed page click the Fulfillmentj a o
intthe column of the Trace tree and
i k s e
( r licen
answer the followingequestions:
o
a) What isa
c dvalueboflethe <orderTotal> element in the inputVariable?
the
b) M
r
e thefesteps
Describe ra to find the orderTotal in the inputVariable.
i s
kac) On-trtheanFlow tabbed page, what is the value of the <carrier> element after the first
r
E oncopy operation is executed in the Assign_shipstatus activity?
n
d) Describe how you located the value for the <carrier> element.
e) On the Flow tabbed page, what is the title of the window that displays activity
information?
f) On the Flow tabbed page, how can you examine the value of the response
message?
g) How do you return to the Flow Trace page for the composite application instance?
Table of Answers for step 7
Step Answer
a. The <orderTotal> element of the inputVariable contains the string value 690.
s a
) h a
o m
c ideฺ
i l ฺ
c. The <carrier> element is an empty XML element, for exampleg ma<carrier/>
t G uafter the
o @ activity,
first copy operation is executed in the Assign_shipstatus d e nas shown in the
d
following image:
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: The Activity Details window shows the changes to the outputVariable after
each copy operation is executed. The top entry is the first copy operation. In this
case, two copy operations are executed by the Assign_shipstatus activity.
d. On the Flow tabbed page, scroll down the visual flow and click the
Assign_shipstatus activity icon.
e. Activity Details
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm BPEL
Note: Since this process is an asynchronous e th process the callbackClient
activity holds the responseja zmThe tlast
data.
s in a synchronous process is a
uactivity
ฺ o
Reply activity. One-way
e r ikaprocesses
e n sedo not have an activity to return a response
message. (
o Trace lic
g. d
Click theaFlow l elink in the breadcrumb path at the top of the Flow Trace
erc ferab
page.
M
r i ka -trans
E on
n
8) Close the Flow Trace page, which is a pop-up window, so that you can return to the
“POProcessing [1.0]” Response tabbed page in Oracle Enterprise Manager.
9) Click the Request tab to prepare for the next test.
10) In a Windows Explorer window, navigate to the D:\labs\podata folder and
verify that the order was written to a file called order_4.xml (or XML file with
the highest sequence number). Open the file and verify that the <orderTotal> element
contains the string value 690, and <payMethod> contains the string paypal. Close the
application and window that you used to display the contents of the XML file.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
M Thisntime
Note:
a s f leave the <payOption> value as credit. Do not change any text in
k traIf you require help to perform this task, use the following substeps:
Eri then
input.
-
na)o On the Request tabbed page, select XML View and delete the supplied text.
b) Open the D:\labs\files\xml_in\po-small-guitar.xml in
JDeveloper (or Notepad) and copy all the text into the Request tabbed page >
XML View text area, replacing any text already in the field.
c) Click Test Web Service.
12) On the Response tab, click the Launch Message Flow Trace link.
structure.
Note: An Assign activity would require a copyList operation or need to use the
copyList XSL function to accomplish similar results.
c. The Assign_orderinfo activity first copied the order elements from the
inputVariable to the outputVariable, and the Transform_fulfillment activity used a
transformation to copy the outputVariable values to the fulfillmentRequest
variable.
d. Yes. If the outputVariable, which is being used as a working copy of the order
data, was modified after it was assigned its data in the Assign_orderinfo and
before the Transform_fulfillment activity is executed the data in the s a
fulfillmentRequest variable can differ from the inputVariable. ) h a
o m
c ideฺ
Note: At this stage, the BPEL process does not modify the outputVariable before
i l ฺ
it is copied to the fulfillmentRequest variable.
g ma t Gu
15) Close the Flow Trace Web browser window.
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
The goal of this practice is to learn how use the following BPEL activities:
• Invoke to invoke synchronous and asynchronous services
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
The changes to the composite application are shown in the following image:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
i k trato the POProcessing composite application assembly model include:
ErThe n -
changes
n•o The ValidateCCService external reference and the wire connecting it to the
ApproveCCOrder BPEL Process component.
• The three JMS Adapter external references (USPS JMSAdapter, UPS
JMSAdapter, FedEx JMSAdapter) and the wires connecting each of them to the
Fulfillment BPEL Process component.
s a
) h a
The changes made to the ApproveCCOrder BPEL Process include: m
• Invoking the synchronous CreditCardValidation composite application l ฺ o
c asiadeฺ
service. This requires that you create an external referencemor a
i
partnerG u for the
link
CreditCardValidation service.
g
@ den t
• Checking the result of credit card validationcby d o tu activity. If the card
ausing aSSwitch
e r
in the <case> branch of the Switch i ฺm e th s place the Fulfillment scope
is valid, then you restructure the ApproveCCOrderito
nactivity.
• Invoking the asynchronous j a zm to BPEL
Fulfillment us component and receive its callback
ฺ
a Fulfillment
message. In this case,
e r ikthe e n se partner link has already been created, in the
ApproveCCOrder
o ( BPELlicprocess, from a wire created between the
d
ApproveCCOrder
c a aband le Fulfillment components in the practices for lesson 7.
r
e fer
a
Inkpart
M s
two thenfollowing image shows the changes implemented in the Fulfillment BPEL
r i
E on-
process: t r a
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
it from the ApproveCCOrder BPEL component. The following image shows the changes
to the composite application:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
To complete these tasks, perform the following i n ฺmsteps:e th
j a zm toopen us the POProcessing
1) On the JDeveloper Application ฺ Navigator,
composite.xml file,
e r ikifait isenotnsalready
e open.
o ( lic
Create the
d
a ab l e
e rcValidateCCService
r External Reference
2) a In the n fe
M composite.xml
s window, drag a Web Services component from the
r i k r a
-t Palette into the External References column.
E Component
o n
n
external reference:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
r c a S tu
e
ฺm e this Web Service window:
Note: If it helps use the following steps to fill in the Create
i n s accept default Type value of
a) In Name enter ValidateCCService,
Reference. ฺ j a zm to uand
e r ika ense
b) To the right o of (the WSDLl icURL field, click the Find Existing WSDLs icon ( ) to
d l e
e rcaSOA
open the
r
Resource
a b Browser window.
c) M
a In the SOA
n s feResource Browser window, select the Resource Palette option from
k a
Eri onthe-trpull-down menu, expand the Application Server > soaserver > SOA >
CreditCardValidation [1.0] (soa_server1) entry, select ValidateCreditCard_ep and
n click OK.
4) In the composite.xml window, verify that the external reference icon has been
added as shown in the following image:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
Create the Wire from ApproveCCOrder
ฺ j a zm to usto ValidateCCService
5) In the composite.xml
e r ikawindow,
e n e a wire from the ApproveCCOrder BPEL
screate
composite icon o ( ValidateCCService.
to the lic Use the following image as a guide:
d l e
e rca erab
a M nsf
k
Eri on-tra
n
As shown in the above image, you can verify the partner link is created if you opens a
the ApproveCCOrder.bpel file, which can be done by double-clicking the ) h a
o m
ApproveCCOrder.bpel file (in the Application Navigator) or the double-clicking
c ideฺ
ApproveCCOrder BPEL Process component icon. i
a Gul ฺ
g m t
6) Verify that your composite application, shows the addition
o @ e n
of the ValidateCCService
r c d Process
external references wired to the ApproveCCOrderaBPEL
S t udcomponent, as
shown in the following image,
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
7) Save the changes to your composite application and the ApproveCCOrder BPEL
component.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
i k tra
ErNote: n -
noThe changes made to the BPEL Process include adding the following activities into
Scope_validatecc:
• An Assign activity to supply the credit card validation request data
• An Invoke activity to initiate a synchronous validateCC operation of the
ValidateCCService
• A Switch activity to check the response returned by the service. In the Switch
activity:
o The Scope_fulfillment is dragged into the <case> branch after you
configure its condition expression to checks for a VALID return string
from the validateCC operation
o An Assign activity is created in the <otherwise> branch to set the order
status to indicate the credit card is invalid.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
If you require help to perform the task of constructingo @flow inside
the
d e nthe
d
r a is Stu
Scope_validatecc activity, perform the followingcsteps:
e
ฺm ePalette
a) Drag an Assign activity from the Component
i n th into the expanded
Scope_validatecc activity. zm
j a t o us
ฺ
e r ika activity
b) Double-click the Assign
e n sename and rename it to Assign_ccinfo.
o
c) Drag an Invoke
(activitylifrom
c the Component Palette and drop it inside
d l e
rca erabafter the Assign_ccinfo activity.
Scope_validatecc
e
d) M
a s f the Invoke activity name and rename it to Invoke_validatecc.
Double-click
n
k -traa Switch activity from the Component Palette and drop it inside
Eri e)onDrag
n Scope_validatecc after the Invoke_validatecc.
f) Double-click the Switch activity name and rename it to Switch_ccvalid.
4) Save the changes to your BPEL process.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k tra
Eri Note:
n -
no The Edit Invoke window is opened when you perform this step.
6) In the Edit Invoke window, when opened already contains the correct Name, Partner
Link, and Operation field settings, because there is only one operation provided by
the service.
To automatically configure variables that supply the request (input) and response
(output) data for the service invocation, use instructions in the following table and
associated screenshots:
Step Screen/Page Description Choices or Values
a. Edit Invoke On the right of the Input field, click the
Automatically Create Input Variable icon ( )
Note: Creating a variable in this way ensures the
variable has the correct XML message structure for
the service request.
b. Create Variable Accept the default variable name, select the Local
Variable option, and click OK.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
b)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
d) ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
Note: When you click a OK the Errors indicator should be removed, provided you
e activity
r i k n s
o (e lice
have correctly configured the Invoke settings.
r c ad toathe
7) Save the changes b leBPEL process.
MeAssign f r
eActivity
i a
Edit the
k -tran s to Supply Credit Card Information
r
E Nowothat
n the input variable has been created for the Invoke activity, you can populate the
n
input variable with the credit card data needed to perform the validateCC operation
provided by ValidateCCService.
8) To populate the input variable for the Invoke_validatecc activity, edit the
Assign_ccinfo activity and create the following two copy operations:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
c) In the Assign window,
e r ikaverify
e n seyour two copy operations have been created and
that
click OK.
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
maBuilder
12) In the Condition Expression window, click the XPath Expression
g t G u( )
icon
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
a ab l e
Click e rcafter er the complete Expression shown.
a M nsfbuilding
OK
ikIn the-tApproveCCOrder.bpel
Er14) ra Design window, verify your condition is correctly
n o n
shown and click outside the Condition Expression window:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k tItrais easier to drag the Scope when it is in the collapsed state. However, the
Eri Note:
n -
o Editor expands the Scope_fulfillment activity after it is dropped in the <case>
nBPEL
branch.
17) Save the changes to your BPEL process.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
caAssignraactivity
b to Assign_invalidcc.
e
19) Rename rthe e
M f
r i ka -trans
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k ra window, verify the copy operation is created and listed and click OK.
i In the-tAssign
Er21) n
no
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k trachanges to your BPEL Process.
i Save-the
Er23) n
no
for an asynchronous invocation pattern to invoke the Fulfillment BPEL Process for orders
with a valid credit card. You use an Assign activity copy the response from the
Fulfillment service to the order status in the outputVariable. The response value
‘completed’ indicates the order has been shipped. The status value ‘waiting’ indicates
some or all the ordered products are out of stock and cannot be shipped.
Note: Use the following image as a visual aid to the layout and sequence of the
activities in the Scope_fulfillment activity:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
If you required o
help
(to createlithe
c flow, then perform the following steps:
l e
caInvokeraactivity
b into Scope_fulfillment and drop it after the
a) Drage ran e
M s f
r i ka Transform_fulfillment
- t r a n activity. Rename the Invoke activity to
E onInvoke_fulfillment.
nb) Drag a Receive activity into Scope_fulfillment and drop it after the
Invoke_fulfillment activity. Rename the Receive activity to
Receive_fulfillment.
c) Drag an Assign activity into Scope_fulfillment and drop it after the
Receive_fulfillment activity. Rename the Assign activity to
Assign_fulfillment_status.
3) Save the changes to your BPEL Process
s a
) h a
o m
c ideฺ
i l ฺ
c) g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e) e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
a ab l e
Configure e rcthe r
Assign_fulfillment_status
e Activity
M s f
rThe
i kaFulfillment
- t r anBPELthe service returns a shipStatus and carrier response values. In this
E section
o nyou configure Assign activity to copy the shipStatus from the
n
fulfillmentResponse to the process outputVariable’s order > status element.
10) In the ApproveCCOrder.bpel Design window, double-click the
Assign_fulfillment_status activity to edit the activity and add a copy operation.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
13) Save the changes to e r
your
a process
ikBPEL se and project.
e n
d o ( completed
Note: You haveamostly l e lic the main end-to-end flow for the ApproveCCOrder
process. The
M f e rabenables you to construct the core flow pattern for the
c practice
ernext
Fulfillment
i k a rBPELa n s process. After this lesson’s practices, you update and change the BPEL
r
E processn -t (and composite application) implementation to include business rules and
flow
human
n o workflow patterns where applicable.
check the shipMethod chosen by the customer and create the order shipping request
message for an invoke activity for each JMS Adapter:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( licthe following steps:
To complete thesed
ca rabtasks l e
perform
e r
a n s fe composite.xml window, double-click the Fulfillment BPEL
M POProcesing
1) In the
k a
Eri Process
n - trcomponent icon, to open it in the BPEL Editor.
no and Configure JMS Adapter Partner Links
Create
2) In the Fulfillment.bpel Design window, create a JMS Adapter partner link
using the following steps:
s a
) h a
o m
c ideฺ
b) In the Fulfillment.bpel Design window, drag the JMSa i l ฺ
g m Adapter G u the
from
Component Palette into the right-hand Partner Link column.
@ e n t
d
Note: This opens the Adapter Configuration Wizardo d
window.
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
3) In the Adapter Configuration Wizard window, step through the pages to configure the
JMS Adapter for the UPS shipping company by using instructions in the following
table and associated screenshots:
Step Screen/Page Description Choices or Values
a. Welcome Click Next.
b. Service Name Service Name: UPSJmsService
Click Next.
b) s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
ca rab l e
e r
c) M
a n s fe
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l
a Gu ฺ
g m t
e)
o @ e n
r c ad Stud
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
h) On the Messages page,
r i k aclick thesBrowse
e icon ( ) to display the Type Chooser
where you can (select e n
e thelicShippingRequest element from the
a o
d ble
internalorder.xsd (either nested in the fulfillment.xsd or the
r c
Project
e Schema raFiles folders):
M s f e
r i ka -tran
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
i)
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
5) In the Fulfillment.bpel Design i n ฺm confirm
window, e th that the partner link for the
j a
JMS Adapter exists in the Partner zm o usthe right-side of the window.
Link column
t
ฺ
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k trathe POProcessing composite.xml window, and observe that a wire has
Er6)i Click
n -on
o created between the Fulfillment BPEL Process component icon and the newly
nbeen
added UPSJmsService external reference icon. Use the following image as guide:
Note: This should remind you that when creating a partner link in a BPEL process it
changes the assembly model in the associated composite.xml file with the
addition of the external reference wired to the BPEL component in which the partner
link is created.
7) Save the changes to your BPEL process
ฺ m e this
f. Operation Operation Type: Select the Produce Message
in use
zm
option.
a ฺ ja e to
Operation Name: Accept the default value of
( e rik ens
Produce_Message
d o l e lic
Click Next.
g. rcaOperation
Produce
e e rab Destination Name (Queue):
M s f jms/demoFulfillmentQueue
r i ka Parameters
r a n
E on-t JNDI Name: eis/demo/Queue
Accept default settings for other fields.
n Click Next.
h. Messages URL: xsd/fulfillment.xsd
Schema element: ShippingRequest
Note: If you click the Browse icon to select the
schema element, then click OK.
Click Next.
i. Finish Click Finish.
j. Create Partner Link Click OK.
9) Save the changes to your BPEL process.
10) In the Fulfillment.bpel Design window, create a JMS Adapter partner link and
using the Adapter Configuration Wizard configure the third JMS Adapter as the
FedEx service by using instructions in the following table (no screenshots are
provided):
i n ฺm e th
g. Produce Operation
Parameters ฺ j a zm to us
Destination Name (Queue):
jms/demoFulfillmentQueue
e r ika ense
JNDI Name: eis/demo/Queue
o ( lic Accept default settings for other fields.
d
ca rab l e Click Next.
h. e r
Messages fe URL: xsd/fulfillment.xsd
a M n s
r i k r a Schema element: ShippingRequest
E on-t Note: If you click the Browse icon to select the
n schema element, then click OK.
Click Next.
i. Finish Click Finish.
j. Create Partner Link Click OK.
11) Save the changes to the BPEL process and to the POProcesing composite application.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
Note: The Fulfillment BPEL Process component
i n ฺm ehasththree wires, where each wire is
j a t us Remember, you could have also
m oreference.
linked to a different JMS adapterzexternal
ฺ
created and configured theaJMS Adapters
composite.xml(e rikwired e
and n
themstoethe asFulfillment
external references in the
BPEL Process component to
o
yield the samedresults. e l i c
r c a abl
Add a
e ftoerChoose the JMS Adapter for the Shipment Request
MSwitch
i k a a n s
r
E In r
-t<case>
this section
n you create the activity sequence in the Scope_shiporder that uses a Switch
with
n othree branches to determine which JMS service is used to send the shipment
request for an order based on the shipMethod value in the FulfillmentRequestMessage
structure in the inputVariable. You then set the correct response values for the status and
selected carrier in the FulfillmentResponseMessage structure of the outputVariable.
13) In the Fulfillment.bpel Design window, expand the Scope_shiporder activity.
Note: On the Component Palette, you might need to click the BPEL Activities and
Component pane to expose the BPEL activities needed for the next set of steps.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
a
rcsequence S u
tthe
Note: Only if you require help to create the flow e is in Scope_shiporder
activity, perform the following steps: inฺm t h
m u s e
a) Drag a Switch activity asฺjthe z
a first activity
to in Scope_shiporder.
a e
k Switch_shiporder.
b) Rename the Switch
( e riactivity
c e ns
c) Expand a d
the l e li activity.
oSwitch_shiporder
rc erab
d) MToethe left
s fof the Switch_shiporder activity icon, click the Add Switch Case icon
k a n
Eri on( -tr) atwice to create two new <case> branches:
n
Note: Alternatively, right-click the <case> title bar and select Edit.
bpws:getVariableData('inputVariable','payload',
'/ns1:FulFillmentRequest/ns5:shipMethod') = 'two_day'
Click OK after both fields are completed. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k -traOnly if you require help to build the expression, use the following
Eri onNote:
n instructions:
i) In the Switch Case window, click the XPath Expression Builder icon ( ) for
the Expression field.
ii) In the Expression Builder window, in the Variables section expand the
inputVariable > FulfillmentRequest tree, select shipMethod and click “Insert
into Expression”
iii) In the Expression field append the text ='two_day' (including the single
straight quotes) and click OK.
16) Configure second (middle) <case> branch name and condition expression for the
USPS service by performing the following steps:
a) On the middle <case> branch, double-click the text “<case>” shown in the title.
bpws:getVariableData('inputVariable','payload',
'/ns1:FulFillmentRequest/ns5:shipMethod') = 'five_day'
Click OK after both fields are completed. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
a right-most l e
17) Configure
e rcthird
f e ab <case> branch name and condition expression for the
rperforming
a M
FedEx service
n s by the following steps:
k
Eri a)onOn-trthea middle <case> branch, double-click the text “<case>” shown in the title.
nb) In the Switch Case window in the General tab page, enter FedEx in Name, and
create and Expression, by clicking the XPath Expression Builder icon ( ), that
compares if the inputVariable > payload > FulfillmentRequest > shipMethod
element is equal to the lower case string literal 'next_day', or if the
shipMethod is equal to 'international'. For example:
bpws:getVariableData('inputVariable','payload',
'/ns1:FulFillmentRequest/ns5:shipMethod') = 'next_day'
or bpws:getVariableData('inputVariable','payload',
'/ns1:FulFillmentRequest/ns5:shipMethod') =
'international'
Click OK after both fields are completed. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
18) Save the changes to your Fulfillment BPEL Process, after g ma thatt G
verifying
u
your
o@ timage: d e n
d
Switch_shiporder activity appears as shown in theafollowing
e rc is S u
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
a ab l e
Note: e rcnames
The erUPS,as USPS, and FedEx (as specified in each of the Switch Case
a M now s f
r i k -tran
settings) appear visual annotations in the title for each <case> branch.
E on
Create
n a Local Variable in Scope_shiporder for Shipping Requests
In this section, you create a variable called shippingRequest whose type is the
ShippingRequest element in the project’s fulfillment.xsd file.
You create an Assign activity called Assign_shiporder, inside Scope_shiporder before the
Switch_shiporder activity, to initialize the variable elements. This variable is used in
transform activities to copy the elements to the message structures sent to the JMS
service selected by one of the Switch <case> branches.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
r ikahelpetoncreate
Note: Only if you require
e se the variable, perform the following steps:
o ( lic
d
a ab
a) On the expanded
c l e
Scope_shiporder, click the Variables icon ( ).
r
e fer window, click the Create icon ( ).
b) M
In the Variables
r i a
kc) In-tthe
r a ns
E on Create Variable window, perform these steps:
n i) In the Name field enter: shippingRequest
ii) In the Type section, select the Element option. Click the Browse icon next to
the Element field, and in the Type Chooser locate and expand Project Schema
Files > fulfillment.xsd and select the ShippingRequest element, click
OK.
iii) Click OK.
s a
) h a
o m
c ideฺ
i l ฺ
g
of the shippingAddress variable (in the Scope_shiporder). Use
mtheafollowing
21) Configure the Assign_shiporder, with three copy operations to initialize
t
theucontents
G steps
o @ e n
(and their associated screenshots as a guide):
r c ad Stud
a) Create a copy operation that copies the
ฺ m e telement
orderId his in the inputVariable to the
i n
orderId element in the shippingRequest e
variable:
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
c) Create a copy operation that
j a t us XML Fragment into the
m theo following
zcopies
ฺ
e r ika ofethe
shippingAddress element
n e
sshippingRequest variable:
o ( lic
d
<ns0:shippingAddressl e
e rca erab
xmlns:ns0="http://www.example.org/ns/fulfillment">
a n s f
M <ns0:street></ns0:street>
k
Eri on-tra<ns0:city></ns0:city>
n <ns0:state></ns0:state>
<ns0:zip></ns0:zip>
<ns0:country></ns0:country>
</ns0:shippingAddress>
XML Fragment area of the copy operation. Observe that the Type in the “From”
section is set to XML Fragment.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
Note: When copying
e r ikana XMLe n se the XML Namespace prefix and its
fragment
associated path(are required
d o l e lic to preserve the BPEL process source XML structure.
ca rtoayour
22) Save therchanges
e b BPEL Process.
M s f e
r i ka -tand
Create r a nConfigure the <case UPS> Branch Activities
E In thisonsection, you create an Invoke activity to invoke the UPSJmsService and Assign
n
with multiple copy operations preparing the JMS service request message. In the same
Assign activity create copy operations to set 'UPS' as the carrier and 'completed' as
the status in the outputVariable.
23) Inside the <case UPS> branch, create the sequence of case-sensitively named
activities listed in the following table:
Activity Type Activity Name
a. Assign Assign_toUPS
b. Invoke Invoke_UPS
s a
) h a
24) Configure the Invoke_UPS activity to execute the Produce_Message operationc o m of ฺ
the
i l ฺ
UPSJmsService, and use the Automatically Create Input Variableaicon to create i d e
local variable, by performing the following steps: g m t Gu a
d o @ den
a) Drag a line from the Invoke_UPS activity tocthe
S tu
r a UPSJmsService
e this
m theeAutomatically
b) In the Edit Invoke Activity window, ฺclick Create Input
Variable icon, and in the Create i n
m o us
Variable window ensure the Local Variable
j a
option is selected. Click ฺOK.
z t
i k a s e
o (er licen
r c ad able
a Me nsfer
k
Eri on-tra
n
25) Configure the Assign_toUPS activity with the following three copy operations:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
b) Append the literal string ' (UPS)'
i n ฺm e h leading space to the custName
including tthe
a z m o us
element in the Invoke_UPS_Produce_Message_InputVariable.
Note: Appending the carrier
a ฺ j text e t customer name is included here so that
to the
i k s
consumer d o (er that
you can see the carrier
application
usedeinnthe shipping message received by the JMS message
licyou use in the testing section of this practice. In this
l
cathe followinge
case ruse
M e f e rab steps to create an Append Operation:
r i nsAssign window, click the Create icon ( ) and select Append
ka i)-trInathe
E on Operation.
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r i ka nse
o l i e '(UPS)' into the carrier element in the
c) Copy the literal(string expression
c
process a
c d ble
outputVariable.
r
e fera
M
r i ka -trans
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
26) Save the changes to your BPEL a Process.
e r i k
e n se
Create and Configure o ( the lic<case USPS> Branch Activities
d l e
rcayou ecreate
In this section,
e raban Invoke activity to invoke the USPSJmsService and Assign
M
withamultiple copy
n f
s operations preparing the JMS service request message. In the same
r i k r a
-t create copy operations to set 'USPS' as the carrier and 'completed'
E Assign
as n
the nactivity
ostatus in the outputVariable.
27) Inside the <case USPS> branch, create the sequence of case-sensitively named
activities listed in the following table:
Activity Type Activity Name
a. Assign Assign_toUSPS
b. Invoke Invoke_USPS
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
o @ denoperation of the
28) Configure the Invoke_UPS activity to execute the Produce_Message
d
USPSJmsService, Use the Automatically Create rcInput S tu icon to create a local
a Variable
e
ฺm e this
variable, by performing the following steps:
i n
a) Drag a line from the Invoke_USPS
j a t o usto the USPSJmsService
zm activity
ฺ
ika ewindow,
b) In the Edit Invoke rActivity
e n se click the Automatically Create Input
Variable icon,
o ( in thelicCreate Variable window ensure the Local Variable
and
d le OK.
optioncisaselected.bClick
r a
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
32) Configure the Invoke_FedEx activity to execute thed o @ den operation of
Produce_Message
the FedExJmsService, and use the Automatically
e StuVariable icon to create
rcaCreateisInput
i n ฺm steps:
a local variable, by performing the following
e th
a) Drag a line from the Invoke_FedEx
j a o usto the FedExJmsService
zm tactivity
ฺ
ika ewindow,
b) In the Edit Invoke rActivity
e n se click the Automatically Create Input
Variable icon,
o ( in thelicCreate Variable window ensure the Local Variable
and
d le OK.
optioncisaselected.bClick
r a
a Me nsfer
k
Eri on-tra
n
Invoke_FedEx_Produce_Message_InputVariable.
Note: Both variables are nested in the Scope called Scope_shiporder.
b) Append the literal string ' (FedEx)' including the leading space to the
custName element in the Invoke_FedEx_Produce_Message_InputVariable. Use
the following steps:
i) In the Assign window, click the Create icon ( ) and select Append
Operation.
ii) In the Create Append Operation window, in the “From” section use s a
Expression for the Type and enter ' (FedEx)' in the Expression field. In ) h a
o m
c ideฺ
the “To” section use Variable as the Type and select the custName child
i l ฺ
ma t Gu
element in the Invoke_FedEx_Produce_Message_InputVariable as the target.
g
c) Copy the literal string expression 'FedEx' into the@
o d e n in the
carrier element
d
process outputVariable.
e rca is Stu
i n ฺm e th into the shipStatus element in
d) Copy the literal string expression 'completed'
the process outputVariable. zm
j a t o us
ฺ
ka Design
34) In the Fulfillment.bpel
e r irepresented
e n sinethe
window, verify that your Scope_shiporder has
o (
the BPEL Process flow
l i c following image:
r c ad able
a Me nsfer
k
Eri on-tra
n
35) Save the changes to your BPEL Process and the POProcessing project.
c) In the Audit Trail or the Flow tabbed page for the ApproveCCOrder, which
activity receives the response from the ValidateCCService? What is the response
messaged child element name that contains the validation information, and what
validation value was returned?
Step Answers for Step 6
a. Yes, the order was processed by the Fulfillment BPEL Process. In the Trace tree on
the Flow Trace the Fulfillment BPEL component appears below the ApproveCCOrder
entry with the state Completed. The Trace tree resembles the following image: a
h a s
m )
l ฺ o
c ideฺ
i
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
names of the Assign_toUPS and related activities in the Switch that confirm the flow
of the shipping request. For example:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: You can also determine this information from the Audit Trail. Remember the
UPSJmsService is selected because the order shipMethod value is two_day, which
is tested in the <case UPS> branch of the Switch activity in the Fulfillment BPEL
Process.
s a
)h a
m
co ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
The child element containingzthe
j a t o usinformation is the <inp1:status> element,
mvalidation
and the value returnedkis ฺ
a the string evalue VALID.
r i n s
(e window
7) Close the Web browser
o l i c econtaining the Flow Trace, Audit Trail or Flow
tabbed page.
r c ad able
M e fer
i a
Read
k the n s
Shipping
a Request from the JMS Message Queue
r - t
E The oShippingr
n Request JMS message is still retained in the JMS queue until a JMS
n
consumer reads the message from the queue.
In this section, you open the files.jws application workspace and a project called
JmsSendReceive containing a Java application that consumes JMS messages from the
JMS queue used by the JMS Adapters in the POProcessing composite application.
You use JDeveloper to run the Receive.java application to display the shipping
request JMS message already sent by testing the POProcessing composite application.
8) In the JDeveloper window, open the files.jws project by using the following
steps:
s a
c) In the Running:JmsSendReceive.jpr – Log” window, to terminate the ) h a
Receive.java application, at the Input prompt press q and then Enter. o m
c ideฺ
i l ฺ
d) Close the Running:JmsSendReceive.jpr window.
g ma t Gu
o @ d e n
Deploy a Supplied JMS Consumer Composite
c a d Application
tu
e r S
i n
the rest of the practices, you deploy the supplied e this and consumption
To simplify management and handling of JMS message delivery
ฺm JMSConsumerDemo during
project, which is a
composite application that:
ฺ j a zm to us
• Reads the JMS messages
e r i ka produced
n se by JMS Adapters in the POProcessing
(
composite application.
o e
lic JMS message to a file called shiporder_#.xml, where
d l e
e rca ea rnumber
• Writes the
# represents
shipping request
ab that is incremented for each message file created. There is
M f
s file per message and the files are stored in the D:\temp folder.
r i ka one r n
message
a
-t image shows the component assembly model for the JMSConsumerDemo
E The ofollowing
n
n
composite application:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
The Fulfillment
o (was notlinvoked
ic by the ApproveCCOrder BPEL process because
d
cacard rwas
the credit l e
bnot valid and Switch activity that checks the
e r a
a n s fe response executed the <otherwise> branch, as seen in the Flow
ValidateCCService
M
k tabbed page for the ApproveCCOrder BPEL component link:
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
c. The status value returned by
j athe
t o us activity is “invalid credit card” as
zmcallbackClient
seen in the expanded k a ฺ
<payload> ethe callbackClient activity in the Audit Trail
of
r i
e ApproveCCOrder
tabbed page for(the e n s activity.
o l i c
r c ad able
a Me nsfer
k
Eri on-tra
n
d. No, a shiporder_#.xml file was not created in the D:\temp folder. The
reason why a file was not created is because the Fulfillment process was not
executed for the invalid credit card use-case, and a shipping request messages was
not sent to any of the JMS adapter services. Therefore, the JMSConsumerDemo
application did not execute to create the shipping order XML file.
17) To run the third and last test, perform these steps:
a) In the JDeveloper Application Navigator, expand the “files” > xml_in project
folders and double-click the po-small-ipod.xml file. Copy all the text in the
file into the clipboard, and paste the text into the Request tab Input Arguments
section, select the XML View, of the on the “POProcessing [1.0]” Web browser
page.
b) Edit the XML elements in the data in the XML View area such that:
The <ns0:shipChoice> element contains the value five_day. s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l
a WebaService. e
c) Clickrc
M e Test
f e r b
r i ka -trans
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
a) To which JMS Adapter service was the
i n ฺmordereshipping
th request sent?
b) Why is the JMSConsumer_ep
j a zm t o usbelow the Fulfillment BPEL
entry shown
ฺ
aFlow Trace?
Component entry inik
e r the
e n se
(
c) Why are theoRouteOrder licand the associated FulfillmentFileService components
d l e
e rcain theerFlow
present
a b Trace?
d) M
a Was a n s f
shiporder_#.xml file created in the D:\temp folder?
r i k r a
E on-t
Stepn Answers for step 18
a. The order shipping request was sent to the USPSJmsService, as seen in the Flow
Trace tree just below the Fulfillment BPEL Component entry.
b. The JMSConsumer_ep entry represents the entry point for the
JMSConsumerDemo composite application. This indicates that the
JMSConsumerDemo composite application was executed when the shipping
request was set to the USPSJmsService.
c. The RouteOrder and the associated FulfillmentFileService components are present
because they are the instances that processed the shipping request message
received by the JMSConsumerDemo composite application.
d. Yes. The shiporder_1.xml file was created in the D:\temp folder, and it
contains the shipping request XML data sent the USPSJmsService.
19) In the JDeveloper Application Navigator, select the POApplication application name
to show the POApplication projects in the navigator tree.
Note: You may close the po-small-ipod.xml window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
The goal of this practice is to learn how to use the following BPEL activities:
• The Flow activity to execute sequences in parallel
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
• The Pick activity to wait for one of several messages or a timeout. In this case,
you do not use a time out.
• The While and FlowN activities for processing multi-element XML (array)
structures.
The practice is presented in two parts that provide the context in which these activities
are used.
The ADF-BC services for the Internal Store and Online Store services are supplied, and
some initial implementations for the Internal Store and Online are also provided. You are
required to perform the following tasks:
• Deploy the supplied ADF application projects as Web services that query their
internal and online stock tables for the quantity of products ordered, and can also
update the stock counts if the products are to be acquired for each order. These
services are required as external references for the respective composite
applications.
• Modify the supplied InternalStore composite application, which contains a single
BPEL process. The BPEL process presently processes one product per order. You
must modify the process with a While activity to handle multiple products per
order, and implement the activities to invoke acquireStock operation which is
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
ca rab l e
e rdepends
a M nsfe on the completion of part 1 tasks. If you do not have enough time,
Note: Part 2
ik consider
then
Erworkspace- t r adeploying the solution projects from the POApplication.jws
nonand composite applications. The changes you make to the POProcessing
in the D:\labs\soln\lesson09\POApplication folder for part 1
services
composite include:
• Modifying the Fulfillment BPEL Process to invoke the InternalStore and
OnlineStore in parallel, giving priority to the InternalStore if both can fulfill the
order. If both stores are unable to supply stock for the order, the order is modified
with a waiting status until an event occurs to replenish stock in the stores.
• Testing the modified POProcessing application.
s a
To complete the deployment tasks, perform the following steps:
) h a
1) On the JDeveloper Application Navigator, open the ADFBCApplicationoworkspace m
file, from the D:\labs\files\ADFBCApplication folder.aUse i d eฺ
ilฺcthe following
steps: g m t Gu
o @ d e n
a) On the JDeveloper Application Navigator, click
c a d
the t u
pull-down menu containing
r
the POApplication (or files) application name,
e and S
iselect
s Open Application.
ฺ m
in use t h
zm
a ฺ ja e to
( e rik ens
d o l e lic
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
2) Deploy the InternalStoreSDO project, i n
by
ฺm e ththe following steps:
performing
a zm o us
a ฺ j
a) In the Application Navigator, click
e t Application Menu and select Deploy >
the
i k s
o (er licen
InternalStoreSDO_InternalStoreSDOProfile > to > soaserver
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
3) Deploy the OnlineStoreSDO project, iby n m e ththe following steps:
ฺperforming
a) In the Application Navigator, j a zclick t us
m theoApplication Menu and select Deploy >
k a ฺ e
i
OnlineStoreSDO_OnlineStoreSDOProfile
er licen s > to soaserver
b) In the Select o (
r c ad Deployment
b l e Targets window, select soa_server1 and click OK.
c) In e
M f e ra – Log” window, monitor and verify that deployment is
the “Deployment
i ka successful.
an s
r -
E 4) Inothe t r
n JDeveloper window, select File > Save All to save changes to the application
nworkspace due to deployment steps.
5) Confirm that InternalStoreService and OnlineStoreService exist and are working by
using the WSIL connection in the Resource Palette. Use the following steps:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
b) Expand the InternalStoreSDO_InternalStoreSDOProfile
d o @ andden
OnlineStoreSDO_OnlineStoreSDOProfile entries,
r c tu that the service entry
a andSverify
e
points InternalStoreService and OnlineStoreServiceisare present, respectively.
ฺm e th
i n
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
6)ika
Test the a n sf
M InternalStoreService with the Test Web Service tool in JDeveloper. Use the
Er following
- t r steps:
na)onOn the Resource Palette, right-click the InternalStoreService entry, and click Test
Web Service.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
rca while S tu
Note: JDeveloper displays the followinge message is sending the message and
waiting for the response. ฺ m
in use t h
z m
a ฺ ja e to
( e rik ens
d o l e lic
In e
c) M
rca eAnalyzer:
the HTTP rab # window (where # is a message request number) confirm
s f
r i ka that rthe
a nresponse (in the right window pane) displays the ProdId SKU101 and
-t value 5. Use the following image as a guide:
E onQuantity
n
7) Test the OnlineStoreService with the Test Web Service tool in JDeveloper. Use the
following steps:
a) On the Resource Palette, right-click the OnlineStoreService entry, and click Test
Web Service.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e r ca s Stu
c) In the HTTP Analyzer: # window (where
i n ฺ hi request number) confirm
m # isea tmessage
that the response (in the right window
z m u s displays the ProdId SKU101 and
pane)
a o
Quantity value 6. Use theฺjfollowing timage as a guide:
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
d) Close the HTTP Analyzer: # window.
Note: The ADF-BC application services deployed are synchronous Web services, and
they can also be used as Service Data Object (SDO) implementations.
one to handle one of two operations checkStock and acquireStock defined in the
component WSDL. In this case, you set a variable to indicate which operation
was requested so that the process flow can manage the request appropriately.
• Adding a While loop and associated iteration control activities to process multiple
product elements and check if stock exists. Activities that obtain the amount of
available stock are also needed for the acquireStock operation so that you can
decrement the amount of stock available by the amount ordered for the operation
that updates the information in the database table.
• Implementing Switch statements to execute different actions for the different a
operations and ensure appropriate responses are returned.
h a s
m )
To complete this task, perform the following steps: l ฺ o
c ideฺ
i
a Gu
Copy the InternalStore Project into the POApplication g m t
Workspace
o @ e n
In this section you copy the InternalStore compositecapplication
r ud into your
ad Stproject
POApplication workspace folder, and open the project
ฺ m e tinhthe is POApplication.
i n e
1) Open a Windows Explorer window,
j a zmandtcopy
o ustheto the
D:\labs\files\InternalStore ฺ folder
r ika ense folder.
D:\labs\mywork\POApplication
e
o ( ic the InternalStore project in the POApplication
lopen
d
2) In the JDeveloper
a ab l
window,e
e
workspacercby using
e r the following steps:
M s f
i kaa) In-tthe n
aApplication Navigator, click the application names on the pull-down menu
E onandrselect
r POApplication.
n
b) In the Application Navigator, click the Application Menu and select Open Project.
c) In the Open Project window, navigate to the
D:\labs\mywork\POApplication\InternalStore folder, select the
InternalStore.jpr file and click Open.
Note: In the Open Warning window with the “Do you want to migrate these
files?” prompt, click Yes. In the Migration Status window click OK.
s a
) h a
o m
c ideฺ
l ฺ
a) Is the checkStock operation a synchronous or an asynchronous iinteraction?
b) Which InternalStoreService operation is used to determine g mtheaavailable
t G u
stock
o @ e n
level for a specific product?
r c ad Stud
c) Which InternalStoreService operations can
ฺ m e be used
t h isto update stock quantity
values in the underlying table? in
zm u se
Note: The SOADEMO a ฺ ja in the
schema e o Database 10g XE instance contains a
tOracle
( e rik ens that maintains the product quantity values. You
table called INTERNAL_STORE
can use a d
the
o le lic Line tool (in Start > Programs > Oracle Database 10g
SQL Command
erc fEdition
Expression
M e rab menu to start SQL*Plus), or the SQL Worksheet in
i ka JDeveloper
a n s to query the database table.
r r
-t for step 3
E SteponAnswers
a.
n It is an asynchronous operation. If you opened the ManageInventory.wsdl
file you can see that all the operations are defined with a single message element.
The checkStock and acquireStock operations represent the requests. The
checkStockResponse and acquireStockResponse operations are for the associated
callback responses.
b. The getInternalStoreView1 operation is used to obtain the product and quantity
available.
Note: This operation executes an SQL SELECT statement for a given product ID.
c. The updateInternalStoreView1 and mergeInternalStoreView1 operations can both
be used to modify the quantity of a given product.
Note: In the practice you use the updateInternalStoreView1 operation to
implement the functionality for the acquireStock operation. The operation
updateInternalStoreView1executes an SQL UPDATE statement. The
mergeInternalStoreView1 executes an INSERT statement (if a row with the
product ID does not exist) or an UPDATE statement (if a row with the product ID
exists).
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e) What does the <case inStock> branch condition rca test,isand u are the actions for
Stwhat
each of the condition outcomes? e
ฺm e th
i n
Step Answers for step 5
ฺ j a zm to us
a. The Invoke_checkinstore
r i k a invokes s ethe getInternalStoreView1 operation.
(e the Invoke
Hint: Double-click c n
e activity to view the settings.
Note: The o l i
d ble a product ID as the input message and returns the
operation accepts
r c a
product
M e ID fand e raquantity available from the database (INTERNAL_STORE table).
i k input a s
b. a The Assign_prodid
n to thecopies the prodId element from the first product element of the
r
E on- t r structure request message used by the invocation of the
n InternalStoreService.
Note: In the Assign activity copy operation the “From” XPath expression is:
/ns1:StoreRequest/ns1:product[1]/ns1:prodId
In this XPath expression, the “[1]” syntax represents the index for the first product
element in a multi-element structure.
c. The result of the copy operation in the Assign_prodinstock is to store a Boolean
result of true or false in the inStock variable. The result depends on the value
of the conditional expression stored in the “From” section of the copy operation.
The condition stores a true value in the inStock variable if the quantity of stock
returned from the invoke operation is more than or equal to the quantity ordered,
otherwise a false value is stored in the inStock variable.
d. The purpose of the Assign_initialize activity is to initialize the inStock variable to
the value true, on the assumption that products are in stock unless the flow
determines it is not. This assign activity is more meaningful when you implement
the flow logic to process multiple product elements.
To create the flow changes represented in the image perform the following steps:
If you require help to perform this task, use the following instructions to create the
variable:
a) On the main process scope, click the Variables icon.
Chooser window.
iv) In the Type Chooser window, select the int entry and click OK.
d) In the Create Variable window, verify your settings match the supplied image
above and click OK to create the variable.
e) Save the changes to your BPEL process.
8) Modify the Assign_initialize with another copy operation to set the variable n to the
number of product elements in the inputVariable.
Hint: Use the count Mathematical Function in the XPath Expression Builder. Use the
s a
following image as a guide: ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
If you require help to perform this task, use the following steps:
a) Double-click the Assign_initialize activity.
b) On the Assign > Copy Operation tabbed page, click the Create icon > Copy
Operation.
count(bpws:getVariableData('inputVariable',
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
'payload','/ns1:StoreRequest/ns1:product'))
In the “To” section, set Type as Variable, select the variable n, and click OK.
d) On the Assign page, click OK.
9) Configure the While activity conditional expression so that the loop continues while
the value in the variable n is greater than zero and while the inStock variable is still
the value true (using the true() Logical Function). For example:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k tra expression should resemble the following:
Eri Your
o n -XPath
n/ns1:StoreRequest/ns1:product[position()=$n]/ns1:prodId
If you require help to change the “From” XPath Expression, perform the following
steps:
a) Double-click the Assign_prodid activity.
b) In the Assign > Copy Operation window, double-click the existing copy operation
row to open the Edit Copy Operation window.
c) In the Edit Copy Operation window, in the XPath field under the “From” section
replace the digit 1 inside the square brackets with position()=$n. For
example:
11) Modify the copy operation in the Assign_prodinstock activity so that the nth product
ID quantity is used in the conditional expression. Use the following image as a guide:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
Note: The simplest way to change
j a zm
t o usExpression is to select the digit 1
the “From”
between the square brackets
k ฺ
a and replace
e it with the highlighted text
position()=$n. r i n s
o (e lice
d morebAssign
12) You requireaone
c le activity in the While sequence to decrement the value
of the e r a
r a value of one at the end of the loop. Use the following image as
neby
a
a
M variable
guide: n s f
k
Eri on-tra
n
a) Drag an Assign activity as last activity in the Sequence inside the While activity.
b) Rename the Assign activity to Assign_next_n.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
a zm o us
Note: The “From” Expression
a ฺ j t
shoulderesemble the following example:
r i k n s
o (e lice – 1
bpws:getVariableData('n')
r c ad able
Mthee fer
14)
r i a ns to your BPEL process and POApplication workspace.
k -trachanges
Save
E on
Modify
n ManageInventory to Handle Each Operation
In this section, you replace the Receive activity with a Pick activity. You modify the Pick
activity by adding another onMessage branch and deleting the onAlarm branch.
The rest of the BPEL flow must be modified to execute the appropriate activities for the
checkStock operation, and additional activities for the acquireStock operation. Therefore
addition Switch activities are required to determine which operation was requested. The
onMessage branch sets a variable to indicate the operation requested so that the Switch
branches can evaluate an appropriate condition and execute the required activities.
15) In the ManageInventory.bpel Design window, at the start of the BPEL process
flow replace the Receive activity with a Pick activity. Use the following steps:
a) Delete the receiveInput activity
b) Drag a Pick activity to the start of the BPEL process.
16) Edit the Pick_1 activity and change its name to Pick_operation and set the
“Create Instance” option by using the following steps:
s a
17) In the ManageInventory.bpel Design window, expand and configure the ) h a
m
Pick_operation to have two onMessage branches and delete the onAlarmobranch.
c ideฺ
i l ฺ
ma t GonMessage
Hint: Click the Add OnMessage Branch icon ( ) to create an additional
branch. Use the following image as a guide: g u
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
r a following
If you require help to perform this task, performcthe S tusteps:
e thisicon.
ฺm ebranch
a) Double-click the first (left-most) onMessage
i n
b) In the OnMessage Branchja zm configure
window,
t o us the following settings:
ฺ
e r ika ense
Partner Link: manageinventory_client (Click the Browse icon to select
the partner link)(
d o l e lic
e rcainputVariable
Operation:
Variable:
checkStock
e rab (Click the Browse icon to select the variable)
a M s f
ik -tran
Er19)
Click OK.
on the second (right-most) onMessage branch to be associated with the
nConfigure
manageinventory_client partner link, the acquireStock operation, and use the
inputVariable. Use the following image as a guide:
'check' in the checkStock onMessage branch. You set the operation variable value
to 'acquire' in the acquireStock onMessage branch. The operation variable is
used in additional flow changes to perform the activities to update the stock data and
return the appropriate callback response.
21) In the main process scope, create a new variable named operation with a string
Simple Type. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
22)nIn the ManageInventory.bpel Diagram window, expand both onMessage
branches of the Pick_operation activity and create a named Assign activity in the each
branch as defined by the following table:
Activity Type and Name Location
a. Assign: Assign_checkstock In the left OnMessage Branch
b. Assign: Assign_acquirestock In the right OnMessage Branch
s a
) h a
o m
c ideฺ
i l ฺ
ma thetstring
23) Configure the Assign_checkstock with a copy operation that stores
g G u literal
d o @ den
‘check’ in the operation variable. Use the image as a guide:
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
25) Save the changes to your BPEL process. i n ฺm e th
ฺ j a zm to us
Modify While Loop with
e r ikatheenacquireStock
se Operation Activities
The While loop needs (the Assign_prodinstock
lic to be executed when the operation=check,
d
a ab
and different activities
o whenl eoperation=acquire. To make this change you add Switch
r c r loop, with a conditional expression on the operation variable and
a Meits <case>
activity, into
configure
the While
n s f eand <otherwise> branches with appropriate activities for each
r i k - t r a
E operation.
non
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
27) Expand the Switch_operation to structure thee<case>rca branch S u <otherwise> branch
tand
as described by the following steps:
i n ฺm e this
a) Drag the Assign_prodinstock a m ointousthe <case> branch.
zactivity
ฺ j t
a addsthee following
e i k
b) In the <otherwise>rbranch, n activities in the sequence listed:
(
o Assign i c e
lactivity
i) Dragaadnew l e renamed to Assign_updstock.
r c b
raInvoke activity renamed to Invoke_updstock.
Mii) eDrag a fnew
e
i ka -tran s
r
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
( branchlicname to operation=check and set the conditional
28) Configure the <case>
o
expression to
c d
a abthatlethe operation variable is equal to the literal string
ensure
r
Me nassshown
'check',
a fer in the following image:
k
Eri on-tra
n
bpws:getVariableData('operation') = 'check'
required variables as Global Variables. Use the following image as a guide to the
Invoke settings:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
30) a Configure f
M nthesAssign_updstock with the following two copy operations:
r i k r a
E on-t
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
Note:
e rcToasetethe
r b XPath expression for the nth product, perform the
acorrect
M f
followingssteps in the “From” section:
ka i)-trSelect
n
E on a the Type as Variable.
r i
n ii) Expand the inputVariable > payload > StoreRequest > product node and select
the prodId element.
iii) In the XPath Expression field add the text [position()=$n] after the
/ns1:product and before the /ns1:prodId in the XPath expression:
/ns1:StoreRequest/ns1:product[position()=$n]/ns1:prodId
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n Note: Verify that the “From” text resembles the following expression:
bpws:getVariableData('Invoke_checkinstore_getInternalStoreV
iew1_OutputVariable','parameters','/ns3:getInternalStoreVie
w1Response/ns3:result/ns2:Quantity') -
bpws:getVariableData('inputVariable','payload','/ns1:StoreR
equest/ns1:product[position()=$n]/ns1:qtyOrdered')
Hint: If you wish, you can copy the left-side of the conditional expression in the
copy operation in the Assign_prodinstock activity, which resembles the above
calculation.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d
ca rab l e
e r
Return
a s fe
M thenacquireStock Response Message
k ra the final change you make to the ManageInventory BPEL Process is to
i this section
ErIn
create
o n
one
- tmore Switch activity to manage the different responses sent to the client using
n
the callback Invoke activities. Again the Switch activity must determine for which
operation (check or acquire) you are returning a response and configure its branches
accordingly.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
n
33) Expand the Switch_response activity iand ฺmconfigure
e h <case> branch conditional
tthe
j a zmvariable
expression to check if the operation
t o uissequal to the literal string ‘check’. Use
ฺ
e r i a ense
the following image as akguide:
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
34) Structure the Switch <case> and <otherwise> branch such that:
a) The <case> branch contains:
i) The Switch_instock activity (and its branches), which is the Switch activity
end of the process.
ii) The callback activity.
b) The <otherwise> branch contains:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika enseactivity
36) Configure the callbackClient_fulfilled to invoke the manageinventory_client
o (
partner link with the acquireStockResponse
l i c callback operation and use
r c adas Input
outputVariable
a b levariable. Use the following image as a guide:
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
38) Close the ManageInventory.bpel
z m window u s and the InternalStore
composite.xml file. Save
a a o
ฺjchangesetot your BPEL process and POApplication
workspace. e r i k ns
(
o le li c e
a d
M erc ferab
r i ka -trans
E on
n
a
Note: The difference in the OnlineStore, as compared to InternalStore assembly )mode, hasis
that the external reference is for the OnlineStoreService (another ADF-BCcserver
l ฺ om thateฺyou
deployed earlier in these practices). The OnlineStoreService queries and
m ai manages
G u iddata in
the ONLINE_STORE database table.
@ g nt
a d o t u de
To complete this task perform the following steps: e r c s S
m h i
1) Open a Windows Explorer window, and
m inฺcopyusthee t
D:\labs\files\OnlineStore
ฺ j a z folder
t o to the
j zm to us
callbackClient_fulfilled, which is for the acquireStockResponse operation.
a
Note: The callback activities are contained in the last Switch activity (called
ฺ
e r ika ense
Switch_operation) of the ManageStock BPEL process. You may need to expand the
( lic
Switch_operation activity to view the callback activities.
o
d l e
e rca erab
b. The Assign_prodid activity copies the first prodId element from the XML array in
the inputVariable to the request message for the Invoke_checkstore activity.
a M nsf
k Note: The Assign_prodid copy operation must be modified to dynamically access
Eri on-tra
the product XML array using the [position()=$n] condition added to the
n XPath expression.
c. The Assign_newqty subtracts the quantity of stock ordered (qtyOrdered in the
InputVariable) from the amount of stock available in the online store database, and
copies the result back into the qtyOrdered in the inputVariable.
The reasons why this logic is performed are:
1. It simplifies the Assign_updstock_data copy operation for setting the new quantity
value to be used to update the database table for the specified product, that is, it does
not need to repeat the subtraction expression already performed.
Note: The copy operations on the Assign_newqty and Assign_updstock_data must
be modified to dynamically access the product XML array using the
[position()=$n] condition added to the XPath expression.
Note: The XPath expression in the <case Any out of stock?> branch conditional
expression makes use of the descendants (//)query on all the product/qtyOrder
elements:
bpws:getVariableData('inputVariable','payload',
'/ns2:StoreRequest//ns2:product/ns2:qtyOrdered') < 0 s a
h a
This XPath expression eliminates the need to loop through all the productฺcqtyOrdered o m) ฺ
a l
iactivity toid
e
elements. This approach was chosen because when you add the FlowN
m tG u process
multiple products you need an array of elements to track which g productsnare in stock. It
o @ e
does not makes sense for multiple FlowN branches to update
r
variable as was done in the While loop of the InternalOrder c ad composite
S tud BPEL
a solitary (single) inStock
the settings:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
(
6) In the ManageStock.bpel
o l ic Design window, drag a FlowN activity before the
d l e
e rca eraactivity.
Scope_stockprocess b Use the following image as a guide:
a M nsf
k
Eri on-tra
n
7) To edit and configure the FlowN_1 activity settings, double-click FlowN_1 activity
icon and perform the following steps:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o
Alternatively, ( the lfollowing
enter ic expression into the N field:
a d l e
M erc ferab
count(bpws:getVariableData('inputVariable', 'payload',
k a n s
'/ns2:StoreRequest/ns2:product'))
Eri on-tra
nb) In the FlowN settings window, click the Browse Variables icon ( ) next to the
Index Variable field and select the process variable n, and click OK after setting
the Index Variable. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
r a
Note: The Scope_stockprocess
ikimage e expands when your drop it into the
sactivity
(
sequence above. e
The c e n
shows the scope in a collapsed state for readability.
o l i
c ad toayour
10) Save therchanges b leBPEL process.
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
12) In the ManageStock.bpel
e r ika eDesignn sewindow, double-click the Assign_newqty
activity and modify
o ( the copylicoperation by replacing the [1] string in, both the
c d
a aand
“From” Expression b lethe “To” XPath expression, with the [position()=$n]
r er
a MeUsenthesffollowing
string. image as a guide:
k
Eri on-tra
n
a) In the first copy operation, with prodId, replace the string [1] in the “From”
XPath expression with the string [position()=$n]. Use the image as a
guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
14) Close ManageStock.bpela
j and
t o us
zmcomposite.xml windows, and save all
ฺ
changes.
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
Note: Ensure that the cursor is placed in or at the end ofg
ma t Gu
the SQLnstatement.
d) In the Select Connection window, select thec a do@ tude
soademo(POApplication)
connection, and click OK. e r i s S
m
inฺ use t h
a m
z to
ฺ j
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k raint_store_query.sql (SQL Worksheet) window, you can observe
Eri e)onIn-tthe
n the query results displayed in the Results tab below the pane containing the
SELECT statement. Use the following image as a guide:
this task:
a) In the Application Navigator, under the files > Application Sources > sql folder,
and right-click onl_store_query.sql and select Open. Alternatively,
double-click the file name.
b) In the onl_store_query.sql (SQL Worksheet) window, confirm you have
the following SQL statement, and click the Execute Statement icon ( ). Use the
following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
Note: Verify the following SQL statement is executed:
d o @ den
Select * from online_store rca S tu
where prod_id in ('SKU101',
e
ฺm 'SKU102',this 'SKU200');
i n e
j a zm select
c) In the Select Connection window,
t o uthes soademo(POApplication)
ฺ
connection.
e r ika ense
( lic
d) In the onl_store_query.sql
o (SQL Worksheet) window, you can observe
a d
c rab
the query results l e
displayed in the Results tab below the pane containing the
e r
a M n fe
SELECTsstatement. Use the following image as a guide:
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
10) On the “InternalStore [1.0]” Test Web Servicerpage, ca under S tuRequest tab Input
the
Arguments section, select the XML viewฺm e
and replace
t is XML data with the contents
hthe
i n
m o us
of the file D:\labs\files\xml_in\prod-in-store.xml, e and click Test
Web Service. ฺj a z t
Note: You can find this r i k a
file in the s e
files > Application Sources > xml_in folder in the
( e c e n
o lenavigator
JDeveloper Application
d li window with the files application selected.
a
a) Onethe
M
rcResponse
f e rabtab, click the Launch Message Flow Trace link.
i s Trace page, click the ManageInventory BPEL component link.
kab) On-trtheanFlow
r
E onNote: You might need to refresh the page until you observe the following results
n in the Flow Trace:
c) On the Instance of ManageInventory Audit Trail page, scroll down and expand
the <payload> for the callbackClient activity at the end of the flow.
s a
) h a
o
ii) Optionally, if you are interested, expand other flow activity entriesm
c iexamine
to
the flow execution sequence, and verify that each time theailฺ d eฺ
m int G
InternalStoreService is invoked with each product Idgsupplied the
u
inputVariable. d o @ den
rctoathe Test
S tu Service page.
d) Close the Flow Trace Web page, and return
ฺ e
m e this Web
11) On the “InternalStore [1.0]” Test Web i n
m inService spage, click the Request tab again, and
modify the qtyOrdered element j a z
value t o
the
u
second product (prodId value SKU102)
a ฺ e
rik TesteWeb
to the value 10, and Click
( e ns Service. For example:
d o le li c
a
M erc ferab
r i ka -trans
E on
n
a) On the Response tab, click the Launch Message Flow Trace link.
c) On the Instance of ManageInventory Audit Trail page, scroll down and expand
the <payload> for the callbackClient activity at the end of the flow.
i) What is the response in the status element of the callback? s a
Answer: It should be out-of-stock, as shown in the following image: ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k Note:
a For a degree of simplicity in the application scenario, the BPEL process
Eri on-trreports an out-of-stock status if any one of the ordered products cannot be
n filled by the amount of stock available. The While loop condition terminates
additional processing when the first product is encountered that does not have
sufficient quantity in the database to fulfill the order.
ii) Optionally, if you are interested, expand other flow activity entries to examine
the flow execution sequence, and verify that each time the
InternalStoreService is invoked with each product Id supplied in the
inputVariable.
d) Close the Flow Trace Web page.
13) On the “InternalStore [1.0]” Test Web Service page, click the Request tab again and
replace all the XML in the XML View with the data from the
D:\labs\files\xml_in\prod-in-store.xml file, and click Test Web s a
) h a
Service.
o m
c ideฺ
a) On the Response tab, click the Launch Message Flow Trace link. i
a Gul ฺ
Note: In the Flow Trace tree there should be six rows ofgthe mInternalStoreService
t
present. o @ e n
b) On the Instance of ManageInventory Audit r c
Trail
tuddown and expand
adpage,Sscroll
ฺ m
the <payload> for the callbackClient_fulfilled
e activity
this at the end of the flow.
i n e
c) What is the response in the j a zm element
status
t o usof the callbackClient_fulfilled?
a ฺ
Answer: It should be
e r ikfulfilled,
e n se as shown in the following image:
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: The process logic does not yet support the condition that there is not
enough quantity for products being acquired. This is omitted to eliminate a further
degree of complexity in the practices. However, the Fulfillment BPEL process
flow modified in the lesson 8 practice titled “Deploy and Test the POProcessing
Composite Application” will first check if the products are available and then
invoke the acquireStock operation.
d) Close the Flow Trace window.
14) In the JDeveloper window, execute the SQL statement to verify that the quantity
values for the products ordered from the INTERNAL_STORE database table have
been decreased. Use the following steps:
( ), and select any of the soademo connections. Verify that you obtain the
following results in the Results tab:
| s a
h a
Note: The product quantities should be less than 5 for each of the listed products.
)
There should be two SKU101 products available, three SKU102 products, and
o m
c ideฺ
four SKU200 products. i l ฺ
g ma t Gu
c) Close the int_store_query.sql window.
d o @ den
Test the OnlineStore checkStock Operation e rca is Stu
m e th
inฺhome
15) On the Oracle Enterprise Managerm
z SOA
u spage, expand the SOA folder in the
a o
Farm navigator, and click theฺj“OnlineStore
a t [1.0]” link.
i k
r page, s e
o (e[1.0]”
16) On the “OnlineStore
l i c enclick Test.
ad ab[1.0]”
17) On the “OnlineStore
r c le Test Web Service page, ensure that the Operation selected
Me nsffor
is checkStock,
a erexample:
k
Eri on-tra
n
Under the Request tab in the Input Arguments section, select the XML view and
replace the XML data with the contents of the file
D:\labs\files\xml_in\prod-in-store.xml, and click Test Web
Service.
Note: You can find this file in the files > Application Sources > xml_in folder in the
JDeveloper Application navigator window with the files application selected.
a) On the Response tab, click the Launch Message Flow Trace link.
c) On the Instance of ManageStock Audit Trail page, scroll down and expand the
<payload> for the callbackClient activity at the end of the flow.
i) What is the response in the status element of the callback? s a
Answer: It should be in-stock, as shown in the following image: ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k a
Eri onii)-trOptionally, if you are interested, expand and examine the flow created by the
FlowN activity. Verify that each branch of the FlowN processes a different
n product Id supplied from the inputVariable.
d) Close the Flow Trace Web page.
s a
) h a
a) On the Response tab, click the Launch Message Flow Trace link.lฺc o m ฺ
i i d e
b) On the Flow Trace page, click the ManageStock BPEL component
g ma tlink.G u
Note: The OnlineStoreService reference row appearso @ e
three times.
d n
d
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri c)onOn-trthea Instance of ManageStock Audit Trail page, scroll down and expand the
n
<payload> for the callbackClient activity at the end of the flow. What is the
response in the status element of the callback?
Answer: It should be out-of-stock, as shown in the following image:
s a
) h a
c) Close the Flow Trace window. o m
c ideฺ
i l ฺ
a the G
21) In the JDeveloper window, execute the SQL statement to verify that
g m u
quantity
values for the products ordered from the ONLINE_STORE @database
e t
ntable have been
decreased. Use the following steps: d o d
e r ca s Stu
a) In the Application Navigator, in the files
i n ฺ t hi under the files >
m eapplication
Application Sources > sql folder,
z s onl_store_query.sql and
m andoright-click
u
select Open. Alternatively,
a ฺ j a t
double-click the file name.
e
rik ens window, click the Execute Statement icon
o e
b) In the onl_store_query.sql
( ic soademo connections. Verify that you obtain the
lthe
( ), and d
select anyl e
of
e rca results
following
e rabin the Results tab:
M f
r i ka -trans
E on
n
Note: The product quantities for the listed products are: three SKU101 products
available, six SKU102 products, and one SKU200 product.
c) Close the onl_store_query.sql window.
s a
) h a
o m
c ideฺ
i l ฺ
c) Close the onl_store_query.sql window.
g ma t Gu
23) In the Application Navigator, select POApplication d o
name@from the
d e n
application pull-
down menu.
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
rca eractivities
Note: The InternalStore
theefollowing
brevityM a and
b OnlineStore composite applications are asynchronous. For
are not illustrated in diagram within the Switch:
a s f
n activities that prepare requests for the invocation of the acquireStock
k• The-tra
Assign
Eri onoperations.
n• The Receive activities for the acquireStockResponse operations
To create the parallel flow in the Fulfillment BPEL Process, perform the following steps:
1) In the JDeveloper Application Navigator, under the POApplication in POProcessing
project, double-click and open the Fulfillment.bpel file in the BPEL Editor
window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
c) e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
d)
ฺ j a zm to us
My Role: Select ManageStockRequester
Click OK.
d. Fulfillment.bpel e r ika ense Verify that the OnlineStore partner link icon has been
Design do
( lic added into the right-hand column.
l e
a) e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
c)
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
d)
activity.
6) In the Scope_checkstock activity, select and delete the Empty activity.
7) Inside the Scope_checkstock activity, create the activities with the name and
sequence listed in the following table:
Activity Type Activity Name
a. Flow Flow_checkstock
b. Switch Switch_selectstore
s a
) h a
Use the following image as a guide:
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
8) Expand the Flow_checkstock activity.
9) Save the changes to your BPEL Process.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
11) First, to configure the Invoke_internalstore
i n ฺmactivity,
e thdouble-click the
Invoke_internalstore activity and m o ituwith
zassociate s the InternalStore with the
ฺ j a
aEnsure that t
checkStock operation.
e r ikLocal e n seyouUseuse the Automatically Create Input
o (
Variable icon to create a
l i c Variable. the following Create Partner Link
r c ad able
image as a guide:
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
b) In the Transformation_internalstore.xsl
c a ab window, expand the source
r
e andfedrag
column r the item element to the product element in the target column.
a M s
r i k -tran
Use the following image as a guide:
E on
n
c) In the Auto Map Preferences window, accept the default settings and click OK.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e) Save the changes to your project, and close
e ca s Stu
rthe
Transformation_internalstore.xsl
i
ฺm e thwindow.
i n
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
15) Save the changes to the
e r ka nsBPEL
iFulfillment e Process.
o ( l ic e
d l e
a ab in the Flow Branch for the Online Store
ConfigurecActivities
e r erright branch of the Flow activity you create an asynchronous
In this M
a f
section, insthe
ik -trpattern
Erinvocation an using an Invoke with the OnlineStore checkStock operation, and a
nonthe
Receive
prepare
with the checkStockResponse operation. You also create a Transform activity to
data for the Invoke activity.
16) Inside the Sequence_1 activity of the right-branch of the Flow_checkstock activity
create the following three activities in the sequence listed:
Step Activity Type Activity Name
a. Transform Transform_onlinestore
b. Invoke Invoke_onlinestore
c. Receive Receive_onlinestore
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
rca is SthetuInvoke_onlinestore
17) To configure the Invoke_onlinestore activity,edouble-click
n ฺm withe the
activity and associate it with the OnlineStore
i thcheckStock operation.
zm Create
Ensure that you use the Automatically s Variable icon to create a Local
uInput
ฺ j a t o
a CreatesPartner
Variable. Use the following
r i k n e Link image as a guide:
o (e lice
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
b) In the Transformation_onlinestore.xsl window, expand the source
column and drag theik
r a element
item seto the product element in the target column.
e
( Preferences e n
c) In the Auto o
d Map
l e lic window, accept the default settings and click OK.
therc
d) In e
a ab
Transformation_onlinestore.xsl window, expand the source
M f e r
i and
ka -tran s
target elements and verify your mapper file resembles the following image:
r
E on
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
21) Save the changeso ( Fulfillment
to the e lic BPEL Process.
d l
e rca erab
M nthe
Configure
a s f Switch to Select the Store that Fulfills the Order
k tra you configure two <case> branches to check if the responses from each
i this section
ErIn n -
noare in-stock. The left-to-right visual order of the <case> branches are important,
store
where the <case> branch for the InternalStore should appear as the left-most <case>
branch (in the source code it appears as the first <case> branch). This ensures that the
InternalStore is selected to provide the products for an order if it returns an in-stock
response. Next the <case> branch for the in-stock condition is evaluated for the
OnlineStore, which is only selected as the supplier of products if the InternalStore returns
an out-of-stock response. Finally, the <otherwise> branch is configured for the
situation where both the InternalStore and OnlineStore return an out-of-stock
response and the order has to be placed in a waiting state until the product quantities in
each store are updated.
s a
h a
23) Configure the left-most Switch Case settings to check the response in the m)
Receive_internalstore_checkStockResponse_InputVariable by performing i l ฺ co theideฺ
following steps: g ma t Gu
a) Double-click the <case> title section on the left-most o @ e n
<case>dbranch.
d
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ewindow,n se
o (
b) In the Switch Case settings
l i c set Name to internalstore=in-
stock a
c d buildbanleExpression that compares the status element in the
and
r
e fera
Receive_internalstore_checkStockResponse_InputVariable with the string 'in-
a Mstock'.n sUse the following image as a guide:
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
For additional instructions,
r i k ause the sfollowing
e steps:
a) To create activities
n
(e in thelic<case
e internalstore=in-stock> branch perform the
following
o
adsteps:able
r c
e anfeAssignr activity into the left <case> branch and rename it to
a M
i) Drag s
k an
Eri on-trAssign_acquireinternal.
n ii) Drag an Invoke activity into the left <case> branch after the
Assign_acquireinternal activity and rename it to
Invoke_acquireinternal.
iii) Drag a Receive activity into the left <case> branch after the
Invoke_acquireinternal activity and rename it to
Receive_acquireinternal.
b) To create activities in the <case onlinestore=in-stock> branch perform the
following steps:
i) Drag an Assign activity into the middle <case> branch and rename it to
Assign_acquireonline.
ii) Drag an Invoke activity into the middle <case> branch after the
Assign_acquireonline activity and rename it to Invoke_acquireonline.
activity to Assign_waiting.
27) Save the changes to the Fulfillment BPEL Process.
29) To configure the Assign_acquireinternal, create two copy operations using the
following steps:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n m e th
ฺthe
b) In the second copy operation, assign
z s string 'completed' to the
mUseotheuliteral
a ฺ j a
shipStatus in the outputVariable. t image as a guide:
rik ens e
o ( e lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic BPEL Process.
d l e
e rca erab
31) Save the changes to the Fulfillment
a M Activities
Configure n s f in the <case onlinestore=in-stock> Branch
r i k t r a
- you configure the Invoke_acquireonline to use the acquireStock operation
E In thisonsection,
n
in the OnlineStore, assign the items already in a local scope variable to the request
message, and configure the Receive_acquireonline to execute the acquireStockResponse
operation of the OnlineStore.
Note: For simplicity, activities that check the response in messaged returned from the
acquireStockResponse operation are not included. For now you assume that the products
are successfully acquired and the order fulfilled.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
( lic
33) To configure theoAssign_acquireonline, create two copy operations using the
d l e
r a erab
followingcsteps:
e
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
m the
zassign s
uliteral
j
b) In the second copy operation,
a ฺ a t o string 'completed' to the shipStatus
i k
in the outputVariable. Use the s e
image as a guide:
o (er licen
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( l ic
d l e
e rca ertoathe
35) Save the changes b Fulfillment BPEL Process.
a M Activities
Configure n s f <otherwise> Branch
r i k t r a
- you configure the Assign_waiting activity in the <otherwise> branch to
E In thisonsection,
n
update the shipStatus in the outputVariable to indicate the order is not shipped because
neither store has items in stock.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
a Design
37) In the Fulfillment BPELikProcess
r se window verify that the Switch_selectstore
e
( following
activity resembles the e n
d o l e lic image:
e rca erab
a M nsf
k
Eri on-tra
n
Do this if and only if the “<case internalstore=in-stock>”, is not the left most <case>
branch. Perform the following steps to fix it in the Source code window:
a) In the Fulfillment.bpel Design window, expand the Switch_selectstore
activity.
s a
) h a
o m
c ideฺ
i l ฺ
g
b) In the Fulfillment.bpel Design window, select the ma onlinestore=in-
“<case t G u
stock>” branch. d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k c) In the Fulfillment.bpel Design window, at the bottom-left side of the
-tra click the Source tab.
Eri onwindow
n
41) Expand the Switch_orderstatus activity and configure with the following steps:
a) Select and delete the <otherwise> branch.
Note: Click Yes, when the Confirm Delete window is displayed.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
r c a S tu
e
ฺm e this
c) Drag the Scope_shiporder into the <case order completed?> branch. Use the
following image as a guide: i n
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
i k tra
Er43) n -
o changes to the Fulfillment BPEL Process.
nSave
Reference rows. Two of the InternalStoreService Reference rows are used to check
if they can obtain the database product quantities and the second two entries are for
updating the product quantities in the database. For example:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k tra
Er9)i On n -
o the Flow Trace, verify your answers by clicking the Fulfillment BPEL
nComponent link, and using the “Instance of Fulfillment” > Flow tabbed page, answer
the following questions:
a) In the Scope_checkstock activity flow, what was the response returned by the
OnlineStore? Explain how you determined your answer.
b) In the Scope_checkstock activity flow, what was the response returned by the
InternalStore? Explain how you determined your answer.
c) In the Scope_checkstock activity flow, what is the name of the first Assign
activity in the Switch that appears after the parallel flow? Describe two ways to
determine the answer.
d) What are the carrier and shipStatus values returned as response in the
callbackClient activity?
s a
) h a
o m
cmessage: ฺ
In the Web browser window that is opened you can view the response i l ฺ i d e
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
b. The result return is in-stock.
m result
zThe s from the InternalStore is
ureturned
ฺ j a t o
determined by clicking
e r ikthea Receive_internalstore
e n se activity icon. In the Activity
( the l“View
Details window, click
o ic xml document” link:
d l e
e rca erab
a M nsf
k
Eri on-tra
n
In the Web browser window that is opened you can view the response message:
You can determine the name either by moving and holding the mouse over the
Assign icon or clicking the Assign icon. Clicking the icon displays the full activity
name in the Activity Details window. The sample image demonstrates the first
technique:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ikadisplay
e n sthee updated stock quantity levels for the internal
o (
10) In the JDeveloper window,
lic the following steps:
d
and online stores by e
performing
l
e rca erab
a) M
a n s f
In the ipod_query.sql window, click the Execute Statement icon ( ), and
k -trathat you obtain the following results in the Results tab:
Eri onverify
n
Note: The original values for the product with SKU303 was 15 and SKU304 was
10. The order acquired a quantity of 10 for each product. Therefore, the database
results of 5 and 0, respectively, are consistent with the processing performed.
b) Do not close the ipod_query.sql window.
11) On the “POProcessing [1.0]” Test Web Service page, click the Request tab.
Note: The Input Arguments section should contain the XML data submitted in the
previous test. If not then select the XML View and replace the XML data with the
contents of the file D:\labs\files\xml_in\po-medium-ipod.xml.
a) First update the <quantity> element values for both products to a value of 5. Use
the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
d) On the Web page that is opened the response from the internal store is out-of-
stock for example:
e) On the Flow tab, scroll down and click the Receive_onlinestore activity. In the
Activity Details window click the click the “View xml document” link.
f) On the Web page that is opened the response from the online store is in-stock s a
for example: ) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
13) On the JDeveloper ipod_query.sql tabbed
a clickSthe
rcpage, tuExecute Statement
e thisthe product quantities by a
ฺmhas reduced
icon and confirm that the ONLINE column i n s e
ฺ j zm toanduSKU304
value of 5 for the two productsaSKU303 from 8 and 7 to the values 3
and 2, respectively. Useik
r a following
the seimage as a guide:
( e e n
d o l e lic
e rca erab
a M nsf
k
Eri on-tra
n
17) On the Flow Trace page, and while viewing the Trace tree, how do you know that the
order was not fulfilled by either of the stores? Use this image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k aIf you examine the rows under the Fulfillment BPEL Component you can
Eri Answer:
see
o n - trthere
that is no instance for a JMS Adapter service. This indicates the order was
nnot shipped. In addition, there is not a second instance for either the OnlineStore or
InternalStore. The presence of a second instance indicates the acquireStock operation
is invoked.
18) On the Flow Trace page, click the Fulfillment link to examine the Audit Trail tabbed
page on the “Instance of Fulfillment” page. Answer the following questions:
a) What is the shipStatus response returned by the Fulfillment BPEL process?
b) What is the XML response from the Receive_onlinestore?
c) What is the XML response from the Receive_internalstore?
d) Have the quantities for the products in the online and internal store database
tables been changed by this instance of the POProcessing composite application?
Explain your answer.
s a
) h a
o m
c ideฺ
b. The response received from the online store is out-of-stock, i l ฺ
aas expected.
g mand G u To
view the response, on the Audit Trail tabbed page scroll down
@ e n t
click the “View
o
ad Stud activity. For
XML Document” link that appears below the Receive_onlinestore
example: r c
e this
ฺ
in usem
zm
a ฺ ja e to
( e rik ens
d o l e lic
e rca erab
a M nsf
k
Eri on-tra
n
The following XML response message is displayed in another Web page:
example:
s a
) h a
o m
c F11,idtoeฺ
d) In the ipod_update.sql window, click the Commit icon orilpress ฺ
ma t Gu
commit the database changes performed by the UPDATEgstatements.
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e) In the ipod_query.sql
e r ika ewindow,
n se click the Execute Statement icon ( ), and
( soademo
select any ofothe licconnections. Verify that you obtain the following
d l e
e rcinatheeResults
results
r a b tab:
a M nsf
k
Eri on-tra
n
BPEL process that obtains the credit card status from the database and performs a credit
limit check on valid cards. The following image shows the changes to the
CreditCardValidation composite application assembly model:
s a
) h a
The changes to the assembly model include: c o m ฺ
i l ฺ i d e
• Create the CheckCCLimit BPEL Process component
• Create new wire between the ValidateCreditCard Mediator g manda CheckCCLimit
t G u
BPEL Process components. d o @ den
• Create a new wire between the CheckCCLimit rcaBPEL S tu and
Process
CreditCardDBService.
e
ฺm e this
i n
Note: When creating new wires from
j a zm
t o uscomponent you also need to create
the Mediator
new transformation files. In this ฺ case, youealso configure filters to ensure you direct the
appropriate cards to the e r ikatarget
correct e n s
service.
o ( l i c
r
You create the c ad able BPEL Process implementation to invoke the
CheckCCLimit
Me nsferto get the credit card status and its credit limit, and check if the
CreditCardDBService
a
ik total-trexceeds
Erorder a the credit limit. This is illustrated in the following image:
no n
Note: If the order total exceeds the credit limit you throw a BPEL fault, which is
Finally, you modify the ApproveCCOrder BPEL process to handle the fault propagated
for the credit limit error, as shown in the following image:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
The ApproveCCOrder BPEL process zm s and sets the order status in the
ufault
handles the
outputVariable response messageฺ j a
a to indicate t o
r i k n s e the order is rejected.
o (e lice
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
Note: To ensure the Property Inspector is visible, select View >a
Property i eฺ
ilฺc Inspector.
d
g m t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
tab. The first place, is the in the message property in the Property Inspector, as
shown in the image for answer “a.” The second location where you can find the
message name is by expanding the Messages section in the WSDL editor by clicking
the “Messages (Show contents)” icon:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
With the Messages section expanded and the caselected
rfault S tu
in the Port Types section,
e is
ฺm inethethMessages
the message name and its definition isnvisible section:
i
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
c. The message fault type name is CreditCheckFault, and the message fault part
name is called fault in this case.
The message type and part names are visible in the expanded message name entry
listed under the Messages section of the WDSL Editor (refer to the last image in
answer “b.”
Note: Clicking the Imports > creditcheck.xsd opens the XSD file in the XML
Schema Editor, where you can expand the CreditCheckFault element and view its
definition and child leaf node, which is named “error’: s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k acreditcheck.xsd and ValidateCreditCard.wsdl windows in
Eri JDeveloper.
4) Close
- the
t r
non
Create the CreditCCLimit BPEL Process Component
In this section you create a new BPEL component in the assembly model and use the
ValidateCreditCard.wsdl for the BPEL component interface.
Note: You use ValidateCreditCard.wsdl file for the interface to make the BPEL
interface compatible with the ValidateCreditCard Mediator component and for the
WSDL fault definition that is used in the BPEL process flow implementation.
5) In the composite.xml file with the CreditCardValidation assembly model, create
a new BPEL Process component called CheckCCLimit and use the “Base on a
WSDL” template. Ensure the BPEL Process component is not exposed as a SOAP
service. Use instructions in the following table and associated screenshots:
option.
WSDL URL: Click the Find Existing
WSDLs icon ( ).
b. SOA Resource Browser Accept the default “File System” project
location for the WSDL, select
ValidateCreditCard.wsdl and click
OK.
c. Create BPEL Process Verify the following additional fields are set:
WSDL URL: s a
ValidateCreditCard.wsdl
) h a
Port Type: validateCC_ptt o m
c ideฺ
Click OK. i l
a Gu ฺ
a) g m t
o @ e n
r c ad Stud
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
c) e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
starts-with($in.request/inp1:CreditCheckRequest
/inp1:CCNumber, '9000')
Note: Enter the expression on a single line. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
13) In the ValidateCreditCard.mplan window, to create the filter expression for
theM s f
first routing rule section whose target is
r i kaCheckCCLimit/checkcclimit_client::validateCC
r a n perform the following steps:
E on-t
na) In routing rule with the CheckCCLimit/checkcclimit_client::validateCC target,
click the Invoke Expression Builder icon ( ) to the right of the <<Filter
Expression>> field.
b) In the Expression Builder window, create the following expression:
not(starts-with($in.request/inp1:CreditCheckRequest
/inp1:CCNumber, '9000'))
s a
) h a
o m
c ideฺ
i l ฺ
c) Save the changes to the Mediator component file. g ma t Gu
d o @ den
14) In the ValidateCreditCard.mplan window,
r ca create S turequest message
the
transformation for the BPEL component by e
ฺmperforming thisthe following steps:
i n
m o us e
a) In the request section for thezCheckCCLimit/checkcclimit_client::validateCC
target, click the “Select a ฺ j a
an existing t
mapper file or create a new one.” icon ( )
r i k n s e
next to Transform
o (e Usingliccontaining
e the text “request: <<Transformation Map>>”
r c ad able
a Me nsfer
k
Eri on-tra
n
b) In the Request Transformation Map window, select the Create New Mapper File
option accepting the default name supplied, and click OK.
c) In the CreditCheckRequest_To_CreditCheckRequest.xsl XLST
Mapper window, map all source elements to their corresponding target elements.
Use the following image as a guide:
existing mapper file or create a new one.” icon ( ) for Transform Using with
text “reply: <<Transformation Map>>”.
Note: Ensure this is done next to the field where Transform Using contains
“reply: <<Transformation Map>>”.
b) In the Reply Transformation Map window, select the Create New Mapper File
option accepting the default name supplied, and click OK.
c) In the CreditCheckResponse_To_CreditCheckResponse.xsl XLST
Mapper window, map the source elements to its corresponding target element.
s a
Use the following image as a guide:
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
d) Save the changes to the XSLT map i n ฺmcloseetheth
and
ฺ j a zm to us
CreditCheckResponse_To_CreditCheckResponse.xsl XSLT
Mapper window. ika e
( e r
c e ns
a d o le li
16) In the ValidateCreditCard.mplan window, observe that the Mediator Editor
rc the Fault
has created
earise) bsection and already created a routing rule to return the fault (if it
rainitial
a M
should s f
to e
the caller. Create the fault message transformation for the
k ra n
Eri BPELn - tcomponent by performing the following steps:
na)o In the Faults section for the “*Initial Caller*::validateCCfault” target, click the
“Select an existing mapper file or create a new one.” icon ( ) for Transform
Using with text “fault: <<Transformation Map>>”.
b) In the Fault Transformation Map window, select the Create New Mapper File
option accepting the default name supplied, and click OK.
c) In the CreditCheckFault_To_CreditCheckFault.xsl XLST Mapper
window, map all source elements to their corresponding target elements. Use the
following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
r i r nsactivities form the main process flow. In subsequent steps you configure
kaNote:-tThese
a
E the onsettings for each of the activities, and then add activities to throw the exception
nand propagate the exception message to the invoker of this BPEL process.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
3) Save the changes to the CheckCCLimit BPEL process diagram.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
5) Save the changes to your BPEL process.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
a m o us
zprocess.
7) Save the changes to your BPEL
a ฺ j e t
i k s
(er licen Activity
Configure the Assign_ccstatus
o
8) To configure r c adthe Assign_ccstatus
a b le activity, double-click the icon and create a single
M e f e r
i kacopy operation
a n s that copies the status element returned in the
r
E variablen - t r
Invoke_ccservice_CreditCardDBServiceSelect_OutputVariable into the status
no of the process outputVariable. Use the following image as a guide:
condition in the <case> branch, and add and configure a Throw activity inside the <case>
branch.
10) In the CheckCCLimit.bpel Design window, expand the Switch_cclimit activity
and delete the <otherwise> branch. Use the following image as a guide to the result:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
11) To configure the <case> branch condition,
i n ฺmperform
e h following steps:
tthe
a
a) Double-click the <case>ฺbranch
j o us
zmtitletsection.
b) In the Switch Case
e r ika ewindow,
settings n se set Name to check status and
limit. do
( lic
l e
e rca erab
a M nsf
k
Eri on-tra
n
Invoke_ccservice_CreditCardDBServiceSelect_OutputVariable.
Important Note: Ensure that you enclose the values comparing the amount and
creditLimit in the number() function to force the comparison to be based on the
numeric value, otherwise the XML expression is compared based on the string
values. Use the following image as a guide:
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k -traThe condition should resemble the following expression, showing where
Eri onNote:
n the number() function is applied and that the literal value 'VALID' is required
to be in uppercase by highlighting them in bold and underline font:
bpws:getVariableData('outputVariable','reply','/ns3:CreditC
heckResponse/ns3:status') = 'VALID' and
number(bpws:getVariableData('inputVariable','request','/ns3
:CreditCheckRequest/ns3:amount')) >
number(bpws:getVariableData('Invoke_ccservice_CreditCardDBS
erviceSelect_OutputVariable','CreditcardsCollection','/ns4:
CreditcardsCollection/ns4:Creditcards/ns4:creditLimit'))
d) Save the changes to you BPEL process
s a
)ah a
13) To configure the Throw_validateccfault activity, using the following image mas
guide: l ฺ o
c ideฺ
i
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
To edit the settings double-click the Throw_validateccfault icon and use instructions
in the following table and associated screenshots:
Step Screen/Page Description Choices or Values
a. Throw > General tab To set the fault Namespace URI and Local
Part in the Faults QName section, click the
Browse Faults icon ( ).
b. Fault Chooser Expand the Project WSDL Files >
ValidateCreditCard.wsdl entry,
select validateCCfault and click OK.
c. Throw > General tab Observe that the Namespace URI and Local
Part fields are filled in by your selection.
Fault Variable: Click the Auto Create Fault
Click OK.
a)
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
b)
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
d)
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k trachanges to your BPEL process.
i Save-the
Er14) n
no
Add a Main Process Catch Branch to Propagate the Exception
In this section you create a Catch branch for the validateCCfault in the main process
scope, and add an Assign activity to set a fault message that is sent to the invoker by
using the fault variable in a Reply activity.
Note: If you did not use a Reply activity with the fault information the invoker can still
see the business fault. However, it is received as if it is a system fault. By using the Catch
branch you are creating a robust error handling sequence.
s a
) h a
16) To configure the Catch branch to handle the validateCCfault, double-click the Catch
o m
branch icon use the following image as a guide to the settings:
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
If needed perform the following steps to create the Catch settings:
a) In the Catch window, in Faults QName, click the Browse Faults icon ( ).
b) In the Fault Chooser, expand the Project WSDL Files >
ValidateCreditCard.wsdl entry, select validateCCfault and click OK.
c) In the Catch window, for Fault Variable click the Browse Variables icon ( ).
d) In the Variable Chooser window, select creditFault and click OK.
e) In the Catch settings window, click OK.
17) Save the changes to your BPEL process.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic resemble the following expression (noting the space
d
Note: The “From” valuel eshould
e rcofatheefirst
at the end rabstring literal parameter in the concat function):
M s f
r i kaconcat('Error:
-t r a n order total exceeds the credit limit of ',
E bpws:getVariableData('Invoke_ccservice_CreditCardDBServiceSele
o n
nct_OutputVariable','CreditcardsCollection',
'/ns4:CreditcardsCollection/ns4:Creditcards/ns4:creditLimit'))
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
Note: if you require help to createzm s settings, perform the following
the Replyuactivity
ฺ j a t o
steps:
e r ika ense
a) In the Reply o ( forlicPartner Link click the Browse Partner Links icon ( ).
window,
c d
a able
b) In e r erLink Chooser window select checkcclimit_client and click OK.
a M the Partner
s f
n window, for Variable click the Browser Variable icon ( ).
k raReply
Eri c)onIn-tthe
nd) In the Variable Chooser window, select creditFault and click OK.
e) In the Reply window, in Fault QName, click the Browse Faults icon ( ).
f) In the Fault Chooser window, expand the Project WSDL Files >
ValidateCreditCard.wsdl entry, select validateCCfault and click OK.
g) In the Reply window, click OK.
21) Save the changes to your BPEL process and CreditCardValidation composite
application.
Note: Creating the Catch block and fault handling is similar to what you did in the
CheckCCLimit BPEL Process in Practice 10-2. In this case, you do not propagate the
exception because it is handled by storing the ‘rejected’ status in the outputVariable to
track the occurrence of an exception.
To complete the task of handling the validateCCfault, perform the following steps: s a
h a
)project
1) In the JDeveloper Application Navigator, if needed expand the POProcessing m
> SOA Content tree and double-click ApproveCCOrder.bpel tolฺopen o
c it inidthe
e ฺ
i
BPEL Editor.
g ma t Gu
Create and Configure a Catch Block on Scope_validatecc d o @ den
e
In this section create a Catch block on the Scope_validatecc
Stu
rca isscope.
i n ฺm e th
2) In the ApproveCCOrder.bpelm
j a z Designt o us create a Catch branch on the
window,
k ฺ
Scope_validatecc scope byaclicking the Add Catch Branch icon ( ) on the scope
eguide:
r i
sidebar. Use the following image n s
as a
o (e lice
r c ad able
a Me nsfer
k
Eri on-tra
n
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
If needed perform the following steps to create the Catch settings:
d o @ den
a) In the Catch window, in Faults QName, click rcathe BrowseS u icon ( ).
tFaults
b) In the Fault Chooser, expand the Partner
e
ฺm Links is
thValidateCCService
> > Imported
m i n s e
WSDL > ValidateCreditCard.wsdl
ฺ j a z to u entry, select validateCCfault and
click OK.
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
c) In the Catch window, for Fault Variable click the Auto-create Fault Variable icon
( ).
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
r a
ikBPEL se
6) Save the changes to e
( your e n
process.
d o l e lic
Deploy the
e rcaPOProcessing
e rab Composite Application
7)ka M s f
Deploy thenmodified POProcessing composite application, by right-clicking the
r i
E on- t r a
POProcessing project name and selecting Deploy > POProcessing > to soaserver.
nOverwrite the existing version and ensure deployment is successful.
o Test a valid card with an order amount less than the credit card limit
o Test a valid card with an order amount exceeding the credit limit.
• Perform the following two tests of the of the POProcesssing composite:
o Test an order with a valid card and order total less than the credit limit to
verify normal processing occurs.
o Test an order with a valid card and order total greater than the credit limit
to test if the exception is correctly handled.
To complete these tests perform the following steps:
1) In the JDeveloper window, to help with selecting credit cards and amounts for the s a
tests display the credit card data by performing the following steps: ) h a
a) In the Application Navigator, select the files application, expand o m
c the files >ฺ
i l ฺ i d e
ma t Gu
Application Sources > sql folder, and double-click creditcard_query.sql.
g
b) In the creditcard_query.sql window, click o @Execute
the d e n
Statement icon
d
( ). e rca is Stu
i
c) On the Select Connection dialog box,n ฺm
select e
h
thet“soademo (POApplication)”
connection, and click OK.jazm o u
s
ฺ t
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
d) Confirm your results in the Results tab with the following image:
Note: The tests will use the second credit card row, credit card number 1234-
1234-1234-1234 that has a credit limit of 20000.
e) Close the creditcard_query.sql window.
2) In a Web browser window, login to the Oracle Enterprise Manager page (URL
http://localhost:7001/em), as the user weblogic with password welcome1.
4) On the “CreditCardValidation [1.0]” Test Web Service page, under the Request tab
Input Arguments section with Tree View mode selected, perform the following steps:
a) Enter 1234-1234-1234-1234 in the CCNumber field and 1000 in amount,
and click Test Web Service.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e r ca s Stu
b) On the Response tab, the reply statusฺm
i n e t hi the value VALID. This is
value displays
expected. For example:
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
5) To perform the second test, click the Request tab, and perform the following steps:
a) The CCNumber field should already have the value 1234-1234-1234-1234
and the amount contains 1000. Replace the amount with 22000 (this is 2000
above the credit limit), and click Test Web Service.
Note: The Instances ID for a synchronous process instances are not normally visible
in the Enterprise Manager Web page for production systems. However, since the
Audit Level has been set to the Development setting (instead of Production) the
faulted synchronous instance information is saved in the SOA Schema database
tables. Otherwise, you would have to consult the log files for errors.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
(
a) Why is the CheckCCLimit
o l ic BPEL Component not showing a Faulted value in the
d l e
rca erab
State column?
e
b) M
a f tell that the validateCCfault business fault has been propagated
How cansyou
n
k -tra to the composite application?
Eri onexternally
n
You can verify this information by clicking the CheckCCLimit BPEL link:
s a
)h a
m
co ideฺ
i l ฺ
In the “Instance of CheckCCLimit” Audit Trail page, scrollg maandtlocate
down G u the Throw
@ such
activity and observe that the fault is thrown and then caught,
o d e n the final Assign
that
a d
and Reply activities are successfully executed tocpropagate tufault message to the
the
e r S
invoker of the BPEL process:
i n ฺm e this
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
s a
a
) hlocate
On the “Instance of ValidateCreditCard” Audit Trail page, you can scrollm to and
coerroridisedetected
the error when the 2-way operation “validateCC” is displayed. Afterlฺthe
i ฺ
the Mediator performs a transformation of the fault message data
m areceived
G ufrom the
BPEL process and it performs a step showing “Rethrowing gfault” after
@action t
n which the fully
qualified QName for the validateCCFault is shown. d o
This u d
is
ethe indicated that the
r c a S t
fault has been propagated externally.
ฺ m e this
m in use
ฺ z
ja e to
a
rik ens
o ( e lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: Now that you have tested the basic functionality for the CreditCardValidation
composite application changes, you can proceed to perform similar tests in the context of
the POProcessing composite application.
If you have time, perform a final test case to test the credit card number (4321-4321-
4321-4321) that has an INVALID status, and verify that the INVALID status is
returned to the caller without performing a credit limit check for INVALID cards.
10) To perform a test with a valid credit card and an order total within the credit limit, on
the “POProcessing [1.0]” Test Web Service page, under the Request tab Input
Arguments section, perform the following steps:
a) Replace the XML data with the contents of the file
D:\labs\files\xml_in\po-small-ipod.xml.
b) Replace the quantity with a value of 1 (one), and then click Test Web Service.
c) On the Response tab, click the Launch Message Flow Trace link.
d) On the Flow Trace page, examine the Trace tree verify that the processing
s a
h a
completed successfully and that the product has been fulfilled by the InternalStore
)
and shipped. Use the following Flow Trace as a guide: o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n
Note: If you desire confirm that the response from the ValidationCCService is the
status of VALID.
e) Close the Flow Trace Web browser window.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri c)onOn-trthea Response tab, click the Launch Message Flow Trace link.
12)nOn the Flow Trace page, confirm that the validateCCfault is thrown for the credit
limit being exceeded for this order.
s a
) h a
o m
c ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
ฺ j a zm to us
e r ika ense
13) On the Flow Traceo (page, examine
lic the Trace tree and answer the following questions:
a) Whatrc isa
d
the final l e
b status in outputVariable supplied to the callbackClient
e f e aorder
rApproveCCOrder
a M
activity insthe
n BPEL process? Explain your answer.
k -trathe order processed by the Fulfillment service? Explain your answer.
Eri b)onWas
nc) Did the fault message get received by the ApproveCCOrder BPEL process?
s a
)h a
m
co ideฺ
i l ฺ
g ma t Gu
d o @ den
e rca is Stu
i n ฺm e th
zmhas tbeen s
uset
a
Note: The reason why theฺjstatus
a o to rejected is because the
ApproveCCOrder BPEL rik process e
nsstatus.
caught the fault condition. In the catch block the
( e
o le li
Assign_rejected activity c e
sets the
a d b
b.
rc eraBPEL
TheeFulfillment process was not invoked by the ApproveCCOrder BPEL Process,
a M s f
nit does not appear in the Trace tree due to the Invoke_validatecc activity
k because
-tra the validateCCfault. This caused the Catch block to execute and end the process
Eri onreceiving
n with the callbackClient activity. Therefore, the Fulfillment BPEL process was not
invoked because its activity sequence could not be executed due to the fault handling
implementation.
s a
)h a
m
co ideฺ
i l ฺ
ma tandGcan
Note: However, that the fault message text is not saved anywhere,
g u be viewed in
o @ den
the Audit Trail pages for the relevant component instances.
d
e rca is Stu
i n ฺm e th
zm Detail
14) Close the Flow Trace and any Activity s
uwindow you have opened.
ฺ j a t o
e r ika ense
o ( lic
d l e
e rca erab
a M nsf
k
Eri on-tra
n