Oracle SOA Activity Guide Vol1
Oracle SOA Activity Guide Vol1
Oracle SOA Activity Guide Vol1
fer a
ans
n - t r
a no
Oracle SOA s ฺ11g: Build
haSuite
Compositeo m ) ide
Applications
u
o o ฺc nt G
ahVolume I •d
u e Guide
Activity
y
@ his S t
z u
a y ez se t
i lp t o u
h
(s nse
z z u c e
y e l i
i l p a
sh
D53946GC20
Edition 2.0
February 2010
'
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
Author Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Clemens Utschig Tom Hardy If this documentation is delivered to the United States Government or
anyone using the documentation on behalf of the United Statesb l e
David McCann
Valli Pataballa Government, the following notice is applicable:
fer a
Vasiliy Strelnikov
an s
David Shaffer
Vikas Anand
U.S. GOVERNMENT RIGHTS
n - t r
The U.S. Government’s rights to use, modify, reproduce, release,
David Twelves
Deirdre Matishak Vikas Jain
a no
perform, display, or disclose these training materials are restricted by
the terms of the applicable Oracle license agreement and/or the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
Contents
( s hilp se to
Practices for Lesson 6 ....................................................................................................... 93
Practice 6-1: Restructure the POProcessing Assembly Model ..................................... 94
z z u cen
li
Practice 6-2: Calculate Order Totals with XSL Transformations................................. 99
ye
i l p a
Practice 6-3: Test the Modified POProcessing Application ....................................... 107
sh Practices for Lesson 7 ..................................................................................................... 111
Practice 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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
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
Practice 10-1: Modify CreditCardValidation Composite Assembly Model............... 330
Practice 10-2: Create the CheckCCLimit BPEL Implementation .............................. 341
Practice 10-3: Modify ApproveCCOrder BPEL to Handle Credit Exceptions .......... 354
Practice 10-4: Test CreditCardValidation and POProcessing Exceptions.................. 358
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
iv
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2010, Oracle and/or its affiliatesฺ
Information about XML Element Names in Practice Documentation
Consider the XML tree structure in the following image of JDeveloper’s XSLT Mapper:
In the sample image observe that each XML element (the tree nodes below the
b le
<sources> root) has an XML namespace prefix, such as “imp1:” in the image
fer a
example. The XML namespace prefix, which maps to an XML Namespace string, is:
ans
• Used to uniquely identify (qualify) each XML element
n - t r
no
• Generated dynamically by the JDeveloper tool that creates the XML structure.
a
has ideฺ
When you carry out the practice instructions in this document, dynamically generated
)
XML namespace prefixes for your XML elements may differ from those shown in the
screenshots of this document.
ฺ c om t Gu
o o e n
Note: Therefore, the practice instructions do not specify the XML namespace prefixes for
h
ya Stu d
XML elements that you work with, even though the screenshots related to those
@
u this
instructions contain XML namespace prefix values. The screenshots are provided as
z
e z e
sample and guide. Your job is to ensure that the XML element names and structures
y
a u s
( s hilp se to
created, mapped, or referenced are correct as documented, and not to be concerned about
different XML namespace values.
z z u cen
ye li
i l p a
sh
) has ideฺ
mthis practice:
The following image depicts the connections createdoin
c G u
o o ฺ n t
h d e
@ ya Stu
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
3) On the JDeveloper Resource Palette, click the New icon ( ) and select New
Connection > Database.
b le
fer a
an s
n - t r
a no
) has ideฺ
c
4) In the Database Connection dialog box, enter ฺthe
m Gdetails:
ofollowing u
oo den t
a) Use the IDE Connections option.ah
@ y S tu
u thi
b) Enter the following fieldzvalues: s
y e z e
a
Connection Name: u s
soademo
Username:hilp o
tsoademo
( s
u cens soademo
Password:
e
z z li
a ye Hostname:
Port:
localhost
sh ilp SID:
1521
XE
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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
b le
text similar to the following display in the terminal window:
fer a
a n s
INFO: FabricProviderServlet.stateChanged SOA Platform-tis r
running and accepting requests n on
s a
a
h SOA
Note: You can ignore the warnings displayed in the command
) e ฺServer command
window. om t Gu i d
o ฺ c n ) > New Connection >
h o d e
Application Server. @ ya Stu
3) In the JDeveloper Resource Palette, click New icon (
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
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.
b le
fer a
ans
n - t r
a no
d) ) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
Note: Show Line Numbers z @
u displaysh iasline number for each line of source code.
z
e toslocate t
e specific lines of code reported for compiler
a y
This is a useful preference
u
( s hilp various
errors and when
e todesign-time tools detect errors in your application code
z z u cens
or structures.
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a
p working u s
( s hilare
Note: If you
e to with these practices in a non-Oracle University
z u cethen
environment
z nsit is likely that you do not have to change this preference. It
li whether your corporate network proxy allows or denies access to
ye depends on
i l p a various external URLs in HTTP requests that are used by JDeveloper.
sh 3) In 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.
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
2) On the u
z z c e n wizard pages, enter the information specified in the
WSIL Connection
e
yfollowing li
table:
a
ilpStep Screen/Page Choices or Values
sh 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:
b le
fer a
ans
b)
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh c)
b le
fer a
a n s
3) To confirm that the WSIL connection is operational, on the Resource Palette
n r
-ttwoexpand
the WSIL node and expand the WSILConnection1 entry. You should osee
nthe following
subfolders called: soa-infra and usermessagingserver, as shownain
image: ) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
e li
i lpay
s h
The following images provide a partial visual representation of the po.xsd and
internalorder.xsd files:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya table d
tudata in the soademo database
In addition, you examine the CREDITCARDS
@ s S
schema used by the purchasez
e zu processing
order thi application.
a y e
usJDeveloper Database Navigator window, from which
i
h se
The following image l p t
representsothe
u (smodify,
you can browse, n and create database structures, as well as query and modify the
z z c e
ye contain:li
data they
a
sh ilp
Note: Familiarization with some of the data and data structures facilitates understanding
the application design and implementation tasks performed in subsequent practices.
b) In the Confirm Close Application dialog box, accept the default “Close
application and remove it from IDE” option and click OK.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
5) In JDeveloper, close the
y z
epo.xsdseand internalorder.xsd windows.
i lp a o u
h
(s nse t
z z u c e
y e l i
sh ilpa
Step Answers
2c) The OrderItem > price element type is xsd:decimal.
2d) i) The payOption element type is payOptionType, and is values are: credit or
paypal, as determined by the enumerated values defined by the type.
2d) ii) The repeating element name is “item” and its type is OrderItemType.
3a) The differences between the 1st level child elements of PurchaseOrder and
order elements are represented by the following table:
In po.xsd In internalorder.xsd
CustId customerId b le
ID orderId fer a
payOption, type:payOptionType payMethod, type:payMethodType an s
shipChoice, type:shipOptionType n - t
shipMethod, type: shipMethodtype
r
ccType and ccNumber, both string a no
creditCard, type:ccInfoType
types
) has ideฺ
ฺ c om t Gu
orderTotal
Note: The payOptionType values are the same as the payMethodType values
h o o e n
d
(as observed by the enumerated values in each schema). The same applies to
ya Stu
the shipChoiceType and the shipMethodType definitions. If a single
@
z z u this
company is sharing these XSD definitions one could rearrange XML
a y e s e
elements definitions to share a consistent type definitions.
u
3b) hilp se to
The “items” element in the internalorder.xsd contains the additional
( s
z z u cen
child called inStock.
ye li
Note: The inStock element is used to track if all items for a given order are in
i l p a stock (value = true) so that an order can be fulfilled. If any item in the order
sh is not in stock (value = false) then the whole order is place in a “waiting”
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.
5) Click the Application Navigator tab, and optionally close the Database Navigator.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
hilp se to
c)
( s
u cen
z z li
a ye
i l p
sh
3) The composite.xml file is opened, and select File > Save All to save the changes
to your Application and Project.
c)
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
d) a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
f)
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh g)
i) b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
j)
b le
7) Select File > Save all to save the changes to the project.
fer a
ans
Create and Wire the Service Mediator Component
n - t r
no
8) Create a Mediator component and wire the ReceivePO service entry point to the
a
Mediator component, by performing the following steps:
) h as eฺ
a) In the Composite Editor (composite.xml),m
o id component into
drag a Mediator
u
the Components column. c
oฺ ent G
h o
a Stud
y
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
Note: The Mediator interface is defined by wiring the SOAP service to the
fer a
Mediator component. The interfaces are implicit.
a n s
n
c) Create a wire from the ReceivePO exposed service icon to the RoutePO
r
-t Mediator
o
n exposed service
icon, by dragging the right-edge arrow icon from the ReceivePO
a
) h s ifollowing
to the left-edge arrow on the Mediator component. Useathe
e ฺ image as a
guide:
c o m Gu d
h o oฺ ent
y a Stud
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
e File >liSave, or click the Save All icon to save the changes to your application.
9) ySelect
ilp a
sh Create 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z
11) In the composite.xmlzwindow,
@
u drag h iasFile Adapter component from the
onyto
t
ethe External
e References column.
Component Palette a
u s
( s hilp se to
z z u cen
ye li
ilp a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
b) a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
d)
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) h as eฺ
13) On the Adapter Configuration Wizard page, continue
o id the File Adapter
m to configure
u
o ฺ c
WSDL interface by importing the internalorder.xsd
n t G XML schema and
o de steps:
ah Sthetufollowing
selecting its “order” element, by performing
y
Step Screen/Page Descriptionu@ thChoices
is Browseor Values
a. Messages ezz e Click for schema file icon.
b. p a y
Type lChooser u s
h i
s nse File t o Click the Import Schema ( ) icon.
c. u (Import Schema Click the Browse Resources icon.
e z z SOA
d. l i c e
Resource Browser In the D:\labs\files\xsd folder select
a y
sh ilp e. Import Schema File
internalorder.xsd, and click OK.
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:
b le
fer a
ans
n - t r
b) a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
c)
b le
fer a
ans
n - t r
a no
e)
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
yf)e li
i l p a
sh
b le
fer a
h)
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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:
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
c)
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
e) ) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
Note: At this time, there are no
z @source is that directly map to the orderPrice,
u thelements
z
items > inStock, itemsy>eitem > itemTotals
e elements in the “XSLT File:
a u s
h i lp
WritePOFileService.wsdl”
t column.
o Mappings for these elements are done in a
subsequent(spractice. s e “for-each” construct is automatically inserted for the “item”
The
z z
element ubecause c eit n
is a repeating element.
y e l i
i l p a6) Click the RoutePO.mplan window, and confirm that the Transform Using field
sh shows the new mapping file. Use the following screenshot as a guide:
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a
p time tyou u s
3) Since this is the
s h ilfirst e o are deploying an application in your JDeveloper
( ns Request window is displayed. Enter weblogic
session,uthe Authorization
z z c e
li field, welcome1 in the Password field, and click OK.
a yinethe Username
sh ilp
b le
fer a
ans
n - t r
a no
) as eฺ
hWeb
Test POProcessing using Enterprise Manager
o m u d
iInterface
In this section you use a Web browser to accessothe c t G
ฺ OraclenEnterprise Manager 11g
Fusion Middleware Control and initiate a test h o
a Stud e
of the deployed POProcessing application.
y
z zu@ the
5) Log in to Oracle Enterprise Manager
open a Web browser byeperforming
11gisFusion Middleware Control application and
t hfollowing steps:
y e
usenter the URL http://localhost:7001/em.
a window,
a) In the Web i l p
browser t o
u ( sh nse
b) On
e z z the Oracle
l i c eEnterprise Manager 11g Fusion Middleware Control login page,
a y enter the User Name weblogic, and Password welcome1, and click Login.
il p
sh
b le
fer a
an s
n - t r
a no
7) On the Test Web Service page, scroll down to the Input ) as esection
hArguments ฺ to the
m u i d
Request tab, select XML View and replace the initial
o ฺ co n XML
t Gcontents with the XML
a h o
data in the file D:\labs\files\xml_in\po-medium-ipod.xml. If you
defollowing steps (or similar):
require help to replace the initial XML y text, use
S t u
the
z u @ h i s
a) With JDeveloper, select
e z File >
e t
Open and browse to the
a
D:\labs\files\xml_in
p y u s folder, select po-medium-ipod.xml and select
Open. hi l t o
( s
u JDeveloper s e
n po-medium-ipod.xml window, press Ctrl +A to select all
b) zInzthe
l i c e
a ye the text, and press Ctrl + C to copy the selection to the clipboard.
il p
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
d) On the “POProcessing [1.0]” Test Web o ฺ compage,
Service
n t G u Test Web Service.
Click
h o d e
@ ya Stu
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
If you see the above error dialog box, then perform the following steps to correct and
fer a
resubmit the data:
a n s
i) On the “Input arguments validation failed” dialog box, click OK. n -t r
o
ncontents of XML
ii) On the Request tab, in Input Arguments section modify s ฺ athe
View field based on the following options: ) ha
o m u ide
(1) If there is extra space or lines at
o ฺcthe
the end of
n t G
all the XML data, delete
a h o
those spaces and lines ensuring
d e
XML data is unaffected, and click
Test Web Service, or y S t u
z u @ h i s
ezor mouse
(2) If there is no t or lines at the end of all the XML data, put
extra space
e
a y
the cursor
p u s pointer after the last character on the last line of
h sei
thel XML t o
data, press Enter, and click Test Web Service
( s
u Throughout n the rest of the course you may have to repeat this process as
e z z
Note:
l i c e
a y required when submitting XML data to initiate tests for each composite
i l p application.
sh
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.
b le
fer a
ans
n - t r
a no
) h as eฺ
c o m Guid folder and
10) In a Windows Explorer window, navigate to the D:\labs\podata
examine the XML file created for the order.oฺ t
h o e n
a) Ensure that the order_1.xmlyfile a hasSbeent udcreated in the podata subfolder, as
z z u@ this
shown in the following image:
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
u JDeveloper
Inzthe
c) z c e n window, close the order_1.xml and the po-medium-
l i
ye ipod.xml windows.
i l p a
sh
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:
• Modify the File Adapter definition of the POProcessing application to use a
logical name instead of a physical directory name for the location of writing files
• Set a reference property of the File Adapter to set the logical name value
• Deploy the updated POProcessing application and test that the order file is saved
in the directory specified for the logical name
• Generate a configuration plan for the POProcessing project that redefines the
value assigned to the logical name property for the File Adapter
• Validate the configuration plan
• Redeploy the POProcessing composite application with its new configuration plan b le
by using Enterprise Manager. fer a
The above tasks are represented in the following image: ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t G u
g. Adapter Configuration Wizard
h o o Click n
Next.
e
Step 6 of 7 – Messages
ya SClick d
tu Finish.
h. @
Adapter Configuration Wizard
zu thi s
Step 7 of 7 – Finish
y e z e
a u s
h lp sfore the
3) To set the path ivalue
( s toorderfiles logical name perform the following steps:
z u composite.xml
a) Inzthe
c e n window, click the WritePOFileService external
l i
ye reference icon ensure that the File Adapter reference is selected.
p a
il b) In the Property Inspector for the Reference – WritePOFileService (in the lower
sh right pane in the JDeveloper window), observe that JDeveloper has added a File
Adapter reference property called orderfiles for the logical name.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
othe application.
4) Select File > Save All to save the changesoto
h e n
ya Compositetu d
Deploy the Modified POProcessing @
u thi s S Application
z z
e deploy
y
5) In the JDeveloper window,
a u s ethe modified POProcessing project by performing
the followingh
s ilp e to
steps:
( nsNavigator, right-click POProcessing project name, and select
u Application
a) Inzthe
z c e
a ye Deploy >liPOProcessing > to > soaserver
sh ilp
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
c) In the Log window, observez @
u the logh is
messages to ensure that deployment is
e z e t
successful.
p y
a o us
i l
Test theuModified s et
(sh nPOProcessing Composite Application
z z c e
li window, enter the Enterprise Manager URL
6) yInea Web browser
a
ilp http://localhost:7001/em, and login as weblogic with password
sh welcome1.
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
b le
fer a
ans
n - t r
a no
b) While still in the Tree View mode, expand the items field, and in the item field (as
has ideฺ
shown above) enter the value 1 in the OrderItemTypeArray Size, and click the
)
document icon.
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e ncomposite application instance
11) On the Flow Trace page, verify that the
ya Stu d
POProcessing
completed all processing successfully.
@
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
2) In the
z zComposite n
u ceConfiguration Plan Generator dialog box, accept the default plan
e l i
yfile name, and click OK.
sh ilpa
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:
b le
fer a
an s
n - t r
a no
4) Select File > Save All to save the changes to the project files.
) has ideฺ
Validate the Configuration Plan
ฺ c om t Gu
h o composite.xml
5) On the Application Navigator, right-clickothe e n file and select
Validate Config Plan. y a t u d
u@ i s S
z
ez se t h
a y u
h i lp t o
u (s nse
e z z l i c e
y
sh ilpa
b le
fer a
7) In the POProcessing_cfgplan_report.log window, verify that the ans
orderfiles Reference Property is replaced with the new value of n - t r
a no
D:\labs\podata specified in the configuration plan being validated. Use the
following image as a guide:
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
h o o
sca_POProcessing_rev1.0.jar file, and click Open.
e n
d. “POProcessing
ya Stu d
Under the Configuration Plan section, select the
[1.0]” Redeploy @ “Configuration plan is on the machine where this Web
u this
SOA Composite ezz browser is running” option, and click Browse.
e. File Upload pay u se
Navigate to the
( s hil se to D:\labs\mywork\POApplication\POProcessing
z z u cen folder and select the POProcessing_cfgplan.xml file,
ye li and click Open.
a
ilp f. “POProcessing Scroll back to the top (if needed) and click Next.
sh [1.0]” Redeploy
SOA Composite
g. “POProcessing Click Redeploy.
[1.0]” Redeploy
SOA Composite
Note: If you require help to perform this task, you can use the following screenshots
as a guide to the instructions in the preceding table:
b le
fer a
b) ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh c)
e)
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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. e
a b l
s fer
- t r an
no n
a
) has ideฺ
ฺ c om t Gu
h
3) In the Definition window, locate the XMLo o e n element with the
a Stthat d
<property>
u the value is D:\labs\podata,
name="orderfiles" attribute,yand verify
@ s
zu withththei configuration plan. Then click OK to close
as expected due to redeployment
y e z e
the window. a u s
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya composite d
tu application instance completed
@
5) After verifying that the new POProcessing s S
z
successfully in the Flow Trace
e zupage, tuse
hi Windows Explorer to verify that the
order_1.xml p a
file has
e
y beenucreated
s with supplied data in the D:\labs\podata
i l t o
folder.
u (sh nse
e z z lice
y
sh ilpa
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
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 b le
The following image represents the composite application design for your fer a
CreditCardValidation project: ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
2) In the New Gallery window, select the SOA Project in the Items list of the Project
fer a
category, and click OK.
a n s
3) In the “Create SOA Project – Step 1 of 2” Project Name window, enternthe r
-t Project
Name: CreditCardValidation, and click Next. n o
a
s window,
4) In the “Create SOA Project – Step 2 of 2” Configure SOA
) haSettings
i d e ฺ select the
ฺ c om t Gu
Composite With Mediator for the Composite Template option, and click Finish.
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
c)
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d)
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
f)
b le
fer a
ans
n - t r
a no
) has ideฺ
g) ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) h as eฺ
7) On the Create WSDL > Reply tab page, to define the
o m Reply id structure for the
message
u
o ฺ c
Mediator component WSDL interface, use instructions
n t
in G
the following table as a
guide: o
ah Stude
y
Step Screen/Page Description
a. Create WSDL >e z zu@ Click
Reply t is or Values
Choices
h the Browse icon next to the URL field.
a y s e
u Expand the Project Schema Files >
b.
h i lp
Type Chooser
t o
u (s nse creditcheck.xsd nodes (if needed) and
e z z l i c e select the CreditCheckResponse element, and
y click OK.
b le
fer a
ans
n - t r
c) a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
b)
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
c)
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om ttab.
G u
h o o
10) In the JDeveloper window, click the composite.xml
e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z u cen window, verify you initial composite assembly model
zcomposite.xml
yresembles thelifollowing image:
11) Inethe
a
sh ilp
12) Select File > Save All to save your changes to the composite application project.
b le
fer a
2) To configure the Database Adapter with the Adapter Configuration Wizard the an s
following instructions: n - t r
n o
a) Adapter Configuration Wizard – Welcome, click Next. s a
Step Screen/Page Description Choices or ) ha ideฺ
Values
c m CreditCardDBService
oName: G u
b. Adapter Configuration Wizard Service
o o ฺ n t
– Service Name h d
Click Next.e
c. Adapter Configuration Wizard
@ ya Click
S u Browse (flashlight) icon next to
tthe
– Service Connection s
zu thi the connection field.
y e z e Select the soademo entry, and click Copy
d. Select IDE Database
a u s
( s hilp se to
Connection Connection.
e.
z z u cen
Adapter Configuration Wizard Observe the JNDI Name has the value
ye – Service li Connection eis/DB/soadmo, and click Next.
i l p a f. Adapter Configuration Wizard Select the “Perform an operation on a Table”
sh – Operation Type option, and ensure the Select check box is
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)
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh d)
b le
fer a
ans
n - t r
a no
f) ) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
h)
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
j)
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
l)
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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
b le
fer a
ans
n - t r
d)
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
f) a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
h)
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh Wire 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.
b le
fer a
ans
a) In the Request Transformation Map window, click the Create New Mapper File
option, accept the default file name supplied, and click OK. n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
p a u s
s
b) In the XSLT
( hilMappere to map the CCNumber element in the Source column
window,
u ccNum
tozthe
z c e ns in the target column, as shown in the following image:
element
ye li
i l p a
sh
b le
fer a
ans
n - t r
no
a) In the Reply Transformation Map window, select the Create New Mapper File
a
has ideฺ
option, accept the default file name supplied, and click OK.
)
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a b) In the XSLT Mapper window, expand the source tree and map the status element
sh 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
z z u@ this
section Request tab and enter
CCNumber: 1234-1234-1234-1234
the following values:
a y e s e
amount: 1000
ilp Service.
to u
s
Click Test
( hWeb e
z z u cens
ye li
i l p a
sh
3) To perform a second test, to enter another request click the Request tab.
b le
a) On the Request tab page, modify the CCNumber value to be 4321-4321-
fer a
4321-4321, leave the amount at 1000, and click Test Web Service.
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s hilp stabe page,
b) On the(Response
to verify that the status string value returned is
z
INVALID,
z n in the following image:
u caseshown
ye l i
i l p a
sh
b le
fer a
ans
n - t r
a no
As a result you learn how to: s ฺ
haacomposite
• Manage service virtualization and how to restructure
with a new Mediator component and makecchanges o
)
m to G ide assembly model
theucomponent wires
without affecting the exposed serviceo
h oฺ client
(external e n t interface)
• Modify the XSL transformation,ybetween a Sthe t d and second Mediator
ufirst
components, to calculate
z z uthe@ t h is In this case, you reuse and modify the
item totals.
a y e
existing XSL Transformation. s e
u
• Create a new
(
Mediator s handilpXSL e to
Transformation,
thesWritePOFileService,
in the routing rule between the second
to calculate the order total using the item
z u e n
y eztotals lic calculated by the XSL transformation between the Mediator
already
components.
sh ilpaNote: There are multiple solutions for calculating the item and order totals. One solution
exists that uses a single XSL file without the need for an additional Mediator component.
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 b le
composite.xml removes the target service from the associated Mediator fer a
ans
routing rule, that is, a routing rule is not deleted when its associated wire is
deleted. n - t r
d) In the Confirm Delete dialog box, click Yes. a no
) h as eฺ
e) In the JDeveloper window, click the composite.xml tabidand verify that the
c o m hasGbeen
u
o o ฺ
wire between the RoutePO and WritePOFileService
n t removed. Use the
following image as a guide:
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh Insert and Wire a new Mediator Component between RoutePO and
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
b l e
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
b) @
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
d) a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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:
b le
fer a
ans
n - t r
no
b) In the composite.xml window, drag a wire from the EnrichPO Mediator
a
“Drag to add a new Reference” icon ( ) to the service
h s ฺicon ( ) of the
ainterface
WritePOFileService external reference.
o m ) u ide
o o ฺc nt G
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
u cen
zzJDeveloper
5) yInethe li window, select File > Save All to save the changes to all files in the
a
ilp project.
sh
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.
sh ilp a)
b le
fer a
ans
n - t r
a no
) has ideฺ
c) ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh d)
b)
c)
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.
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o the items
e n > item element, if required)
c) Drag a line from the itemTotal (expanding d
yahandleSoftuthe sum function in the middle
from the source on to the left-side
@
column. z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
d) Drag a line from the right-side handle of the sum function to the orderTotal
element in the target column.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b)
b le
fer a
ans
n - t r
c)
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o
5) In Windows Explorer, verify that the order_2.xml e nfile has been created with
ya folder. tu d
supplied data in the D:\labs\podata
@ s S
e z zu thi
a y u s e
( s hilp se to
z z u cen
ye li
ilp a
sh 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
c om ttwo
After modifying the assembly model you edit theฺfollowing G u process
BPEL
components and create their structure with h o
theiroinitial Scope,
e n Assign, and Transform
activities: ya Stu d
1. The ApproveCCOrder BPEL z @
u process h isthat validates the credit card and is later
z t
ehuman workflow
e to manually approve orders if their total
a y
modified to include
u s
( s hilp BPEL
exceeds 3000.
e toprocess that performs processing tasks to fulfill approved
2. The Fulfillment
z z
orders. c ns processing includes checking if stock (inventory) for the order
u Fulfillment
e
li from an internal and online store, selecting the store to supply the
ye is available
ilp a
sh products for an order, and sending the order to a shipping company.
b le
fer a
ans
n - t r
To complete these tasks perform the following steps:
a no
) as folder.
1) In the JDeveloper Application Navigator, expand the POProcessing
hContent e
project and
ฺ
double-click the composite.xml file under the SOA
omyoutdoGnot d
uiperform
Note: If the composite.xml file is alreadyฺc open this step.
o o n
2) In the composite.xml window,ytoaadd h a new t u de component, drag the BPEL
BPEL
Process icon from the Componentu@Palette
i s S the Components column.
into
z
ez se t h
a y u
h i lp t o
u (s nse
e z z l i c e
y
sh ilpa
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
( ).
b le
fer a
ans
n - t r
c)
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
e)
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
5) Verify that your composite.xml assembly model resembles the following image:
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
6) Click File > Save All to savez @ s files in the POProcessing project.
uchangesthtoiall
y e z e
a u s
( s hilp sBPEL
Add the Fulfillment
e to Component
z z u youcadd
In this section,
e nthe Fulfillment BPEL Process component to the composite
y e
application l i
assembly model, and create wires from the EnrichPO Mediator component
a
ilpand the ApproveCCOrders BPEL process to the Fulfillment BPEL process. Use the
sh following image as a guide:
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
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: e
a b l
s fer
- t r an
no n
a
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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 b le
component, click and drag the “Drag to add a new Reference” icon ( ) from the fer a
ans
n - t r
right edge of the EnrichPO Mediator component to the left edge service interface icon
( ) of the Fulfillment BPEL component.
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a11) To create a wire from the ApproveCCOrder BPEL component to the Fulfillment
sh BPEL component, click and drag the “Drag to add a new Reference” icon ( ) from
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.
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b)
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
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 ( ).
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y z
e to savesethe transformation map file and
g) Select File > Save
i a All
lp file o u
h
(s nse
EnrichPO.mplan t changes.
z z u c e
9) Close
y e l i
the EnrichPO.mplan and order_To_FulFillmentRequest.xsl
ilpa
windows.
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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
sh ilpa
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ
b) Double-click the name of the assign activityc oandmrename
t G u
it to Assign_orderinfo.
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
c) z z
Dragu a Scope c e n from the Component Palette into the flow after the assign
activity
ye activity. l i
i l p a
sh
b le
fer a
ans
n - t r
a no
hasinto
e) Drag another Scope activity from the Component )Palette
i d e
theฺ flow after the
Scope_validatecc activity.
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
3) Select File > Save to save the changes to the ApproveCCOrder BPEL Process.
n - t r
Configure the Assign_orderinfo Activity a no
In this section, you edit the Assign activity and create a copy
) as etoฺ store a working
hoperation
c o m Guid
copy of the order from the inputVariable in the outputVariable.
4) In the ApproveCCOrder.bpel window, h o otoฺ edit ethenactivity
t and add copy
y a
operations double-click the Assign_orderinfo t u d
activity.
Note: Alternatively, you can u @
right-click i s S
e z z
e t Assign_orderinfo activity and select Edit.
h the
p a y us
i l t o
u (sh nse
e z z lice
y
sh ilpa
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
Note: When you select an element in a o ฺ comtreentstructure
variable Gu you are creating an
h
XPath expression for that elementathatois addeddeto the BPEL source code in the
u The XPath expression helps the
y attributeStvalues.
@
associated activity XML element s
zuXML fragment
BPEL Engine extract z
e the
e thi or value and copy it to the target
element.
p a y us
i l t o
c)
u (sh nse
e z z lice
a y
i l p
sh
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. b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh 9) Confirm 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 ( ).
b le
fer a
ans
b)
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
d)
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
15) In the Variables window, create the fulfillmentResponse variable and set its type to
the FulfillmenResponseMessage type defined in the project fulfillment.wsdl
has ideฺ
file. Use instructions in the following table as guide (no screenshots are provided):
)
Step Screen/Page Description c om t Gu
Choices or ฺValues
a. Variables h o oCreate icon
e n( ).
Click the d
ya fulfillmentResponse
tu
b. Create Variable @Name:
s S
e z zu Type: i the Message Type option and click the
thSelect
a y e
usBrowse Message Types icon ( ).
i l p t o
c. (sh nse
Type Chooser
u
Expand the Message Types > Project WSDL Files >
e z z l i c e Fulfillment.wsdl > Message Types folders,
y select the FulfillmentResponseMessage,
sh ilpa and click OK.
d. Create Variable Confirm the following field settings:
Name: fulfillmentResponse
Type: Select the Message Type option
Message Type: (without the namespace)
FulfillmentResponseMessage.
Click OK.
b le
fer a
a n s
Note: The fulfillmentRequest and fulfillmentResponse variables are defined
n r
-t to have
message structures compatible with the Fulfillment BPEL processn o
their message types are obtained from the WSDL file createdsfor a theinterface, because
Fulfillment
BPEL Process component interface. ) ha ideฺ
ฺ c om t Gu BPEL Process.
17) Select File > Save to save the changes to the ApproveCCOrder
h o o e n
a Stu d
Create a Transform Activity@ inythe Scope_fulfillment Activity
u i s
zz eactivity
In this section you create a Transform
y e th to copy the contents of the outputVariable
into the fulfillmentRequest
i l p t us Therefore the Transform activity must be
a localo variable.
( h se
added inside thesscope to access the fulfillmentRequest variable.
z z u celements
Note: The children e n of each variable are the same; therefore, the transformation
mapy e
is quickly l i
created by mapping the parent elements and using the Automap tool to
a
ilpcomplete the XSL mapping required.
sh 18) In 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 b le
fer
map file called Transformation_to_fulfillment. Use instructions in the following table
a
ans
and associated screenshots as a guide:
n - t r
Step Screen/Page Description Choices or Values
a no
has ideฺ
a. Transform > Transformation Next to the Source section, click the Create icon
( ). )
b. Source Variable ฺ c om t Gu
Source Variable: Select outputVariable
h o o e n
Source Part: payload is already selected
ya Stu d
@ Click OK.
c. z u this
Transform > Transformation
z Target Variable: fulfillmentRequest
a y e s e (should already be selected. If not select it)
u
( s hilp se to Target Type: payload (should also be selected)
b le
fer a
ans
n - t r
a no
) h as eฺ
b)
c o m Guid
h o oฺ ent
y a Stud
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
20) In the Transformation_to_fulfillment.xsl
ฺ c om twindow,
G u create the mappings
rules such that all elements in the source oareomappedeto
ntheir respective target
elements by performing the following h
yasteps:Stu d
a) Drag the order element z @
inuthe source
h s to the FulfillmentRequest element in
icolumn
e z e t
the target column.
a y u s
lp Preferences
hiMap to window, accept all default settings and click OK.
( s
b) In the Auto
u that s e
nelements
c) z z c e
e the targetliby expanding theinchild
Confirm all the source are mapped to their respective elements in
y node. Use the following image as a guide:
sh ilpa
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d
yaApproveCCOrder.bpel
tu
22) In the JDeveloper window, close
u@ the
i s S window.
y e zz e th
i l p a o us
( s h se t
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
Note: If you require help to perform this task, in the Fulfillment.bpel window
use the following steps:
b le
fer a
ans
n - t r
a no
7) Collapse each of the Scope activities and save the changes to your project.
) h as eฺ
Add and Configure an Assign Activity in Scope_shiporder
c o m Guid
h o oฺ outputVariable
In this case, you initialize the response data in the
e n t with hard-coded string
that are later replaced with dynamic results.
y t ud enables you to learn how to
a ThisSsection
z z u@ this
create two copy operations in the same Assign activity.
8) In the Fulfillment.bpel
a y e window,s e expand the Scope_shiporder, drag an Assign
u
s h asp asguide:
activity into theilscope,
following (image e
andto
rename the Assign activity to Assign_shipstatus. Use the
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o operation,
ocopy e n perform the following
Note: If you require help to createathe
y tu d
steps: @ s S
e z zu thi
i) On the Assigna y> Copyu s e tabbed page, click the Add icon ( ) and
Operations
select h
s ilp Operation.
Copy
e to
( nsCopy Operation window, in the “From” section select
ii)zu
z e
In the Create
c
li as the Type, and in Expression enter: 'none' (including the
ye Expression
i l p a single quotes).
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
o
Note: If you require help to create the
h o operation,
copy e n perform the following
steps: ya Stu d
z @
u this
z
i) On the Assigny>eCopy Operations
e tabbed page, click the Add icon ( ) and
a u s
( s hilp Operation.
select Copy
e to
ii)zu
z c e nsCopy Operation window, in the “From” section select
In the Create
li as the Type, and in Expression enter: 'none' (including the
ye Expression
i l p a single quotes).
sh 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.
b le
fer a
ans
n - t r
n o
a
s ฺ
11) Collapse the Scope_shiporder activity, and close the Fulfillment.bpel window,
and save the changes to the POProcessing project. ) ha
o m u ide
o o ฺc nt G
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
yNote: i
e If you lrequire help to perform this task, use the following substeps:
i l p a
sh a) On the “POProcessing [1.0]” page, click Test.
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
7) On the Flow Trace page, to examine yathe Fulfillmentd
tu BPEL Process in the Audit Trail
@ s S
answer the following y e zzu link
tabbed page click the Fulfillment
questions: e thinithe Instance column of the Trace tree and
i l p a o us
a) What issthe
( h sofethet <orderTotal> element in the inputVariable?
value
b) z z u thecesteps
Describe n to find the orderTotal in the inputVariable.
l i
yc)e On the Flow tabbed page, what is the value of the <carrier> element after the first
il p a
sh copy operation is executed in the Assign_shipstatus activity?
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.
b le
fer a
ans
n - t r
a no
c.
) hasactivity,
The <carrier> element is an empty XML element, for example
first copy operation is executed in the Assign_shipstatus i d
<carrier/> after the
e ฺas shown in the
following image: ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
ilp a
sh
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
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
Note: Since this process is an asynchronous
y d
a Stu process the callbackClient
BPEL
@ Thehilast
activity holds the responseudata.
z s activity in a synchronous process is a
Reply activity. One-way
e z processes
e t do not have an activity to return a response
message. a y u s
h i lpTrace link
t o
g.
u (s nse
Click the Flow in the breadcrumb path at the top of the Flow Trace
e z z lice
page.
y
sh ilpa
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.
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z n the <payOption> value as credit. Do not change any text in
u timeceleave
Note:
ye This l i
i l p a the input. If you require help to perform this task, use the following substeps:
sh a) 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.
u
thezBPEL
(shprocess.
Fulfillment BPEL Process
n s e service interface, it does not have activities to invoke
e z l i c e
14)yOn the Flow Trace page, click the ApproveCCOrder link and use the Audit Trail or
sh ilpa Flow tabbed pages to answer the following questions:
a) What change has been made by the Assign_orderinfo activity?
b) Expand the payload containing the fulfillmentRequest variable for the
Transform_fulfillment activity. Alternatively, on the Flow page click the
Transform_fulfillment activity icon to display the variable contents in the Activity
Details window. Have all the item elements from the outputVariable (the order)
been copied to the fulfillmentRequest variable? Explain your answer.
c) What sequence of activities enabled the fulfillmentRequest variable to obtain its
values?
d) Is it possible for the values in the fulfillmentRequestVariable to differ from those
stored in the inputVariable?
Table of Answers for Step 14
Step Answer
a. The outputVariable has obtained a copy of all elements received by the
inputVariable when the BPEL process was executed.
The goal of this practice is to learn how use the following BPEL activities:
• Invoke to invoke synchronous and asynchronous services
• Receive to receive a callback from an asynchronous service
• Switch to select a different sequence of BPEL activities to be executed
Part one and part two of this practice build on earlier practices by implementing
additional activities in the BPEL Process components of the POProcessing composite
application.
The changes to the composite application are shown in the following image:
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p aThe changes to the POProcessing composite application assembly model include:
sh • 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.
b le
fer a
ans
The changes made to the ApproveCCOrder BPEL Process include:
n - t r
a no
• Invoking the synchronous CreditCardValidation composite application as a
service. This requires that you create an external reference or partner link for the
CreditCardValidation service.
) has ideฺ
ฺ c om t Gu
• Checking the result of credit card validation by using a Switch activity. If the card
h o o e n
is valid, then you restructure the ApproveCCOrder to place the Fulfillment scope
ya Stu
in the <case> branch of the Switch activity. d
@
u this
• Invoking the asynchronous Fulfillment BPEL component and receive its callback
z
y e z
message. In this case, the Fulfillment partner link has already been created, in the
e
a u s
ApproveCCOrder BPEL process, from a wire created between the
s hilp se to
ApproveCCOrder and Fulfillment components in the practices for lesson 7.
(
z z u cen
In part li
ye two the following image shows the changes implemented in the Fulfillment BPEL
il p a
process:
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu
To complete these tasks, perform the following steps:d
1) On the JDeveloper Application
z @
u Navigator,
h is open the POProcessing
z
eif it is not t
ealready open.
composite.xml file,
a y u s
s hilp se to
Create the(ValidateCCService External Reference
z u e n
2) yInethe lic
z composite.xml window, drag a Web Services component from the
a
ilp Component Palette into the External References column.
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
c o m Gu
ฺ
Note: If it helps use the following steps to fill
o n t Web Service window:
o in theeCreate
a) In Name enter ValidateCCService, y h
a Sand t udaccept default Type value of
Reference.
z z u@ this
a y e s e
lp
b) To the rightiof the WSDL
t o uURL field, click the Find Existing WSDLs icon ( ) to
open the h
(sSOA nResource
se Browser window.
z u e
yc)ezthe
In the SOAlicResource Browser window, select the Resource Palette option from
i l p a pull-down menu, expand the Application Server > soaserver > SOA >
sh CreditCardValidation [1.0] (soa_server1) entry, select ValidateCreditCard_ep and
click OK.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stto d
u ValidateCCService
Create the Wire from ApproveCCOrder@
zu create s
thi a wire from the ApproveCCOrder BPEL
5) In the composite.xml e zwindow,
e
yValidateCCService.
composite icon to
i l p a
the
t o us Use the following image as a guide:
h
(s nse
z z u c e
y e l i
sh ilpa
b le
fer
As shown in the above image, you can verify the partner link is created if you open a
the ApproveCCOrder.bpel file, which can be done by double-clicking the
ans
- t r
ApproveCCOrder.bpel file (in the Application Navigator) or the double-clicking
n
ApproveCCOrder BPEL Process component icon.
a no
aofs the ValidateCCService
6) Verify that your composite application, shows the addition
) h eฺ
external references wired to the ApproveCCOrder m
o BPEL Process
u i dcomponent, as
shown in the following image, c
oฺ ent G
h o
a Stud
y
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
7) Save the changes to your composite application and the ApproveCCOrder BPEL
component.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh Note: The 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.
ฺ c om t Gu
Activity Type Activity nameoo nPurpose
a. Assign h d e
a Stu Assign credit card number to
y
Assign_ccinfo
b le
fer a
ans
n - t r
a no
s ฺ
haflow
If you require help to perform the task of constructing)the
m i d e the
inside
Scope_validatecc activity, perform the followingosteps: G
ฺc nt u
o o
a) Drag an Assign activity from the Component
Scope_validatecc activity. y de into the expanded
ah StuPalette
b) Double-click the Assignz z u@ name
activity t h isand rename it to Assign_ccinfo.
a y e s e
ilp activity
c) Drag an Invoke u
tofrom the Component Palette and drop it inside
( s h e
z z u censafter the Assign_ccinfo activity.
Scope_validatecc
li the Invoke activity name and rename it to Invoke_validatecc.
yd)e Double-click
i l p a
sh e) Drag a Switch activity from the Component Palette and drop it inside
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh Note: 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b)
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
d) z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
uthe Errors
h isindicator should be removed, provided you
Note: When you clickzOK
e thesInvoket
e activity settings.
a y
have correctly configured u
s hilpto the
7) Save the changes
( e to process.
BPEL
z z u cens
yethe Assign
Edit li Activity to Supply Credit Card Information
a
ilpNow that the input variable has been created for the Invoke activity, you can populate the
sh 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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @ is two copy operations have been created and
u thattyour
h
e z
c) In the Assign window, verify
click OK. pay u se
( s hil se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
n o
a
12) In the Condition Expression window, click the XPath Expression
s Builder icon ( )
h a
) uide ฺ
o m
o o ฺc nt G
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z
ClickzOK n the complete Expression shown.
u aftercbuilding
e
ye l i
i l p a14) In the ApproveCCOrder.bpel Design window, verify your condition is correctly
sh shown and click outside the Condition Expression window:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a Note: It is easier to drag the Scope when it is in the collapsed state. However, the
sh BPEL Editor expands the Scope_fulfillment activity after it is dropped in the <case>
branch.
17) Save the changes to your BPEL process.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z
19) Renameuthe Assign
c e nactivity to Assign_invalidcc.
ye l i
il p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a21) In the Assign window, verify the copy operation is created and listed and click OK.
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a23) Save the changes to your BPEL Process.
sh
Note: Use the following image as a visual aid to the layout and sequence of the
activities in the Scope_fulfillment activity:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
ilpto create
If you requirehhelp
s e tothe flow, then perform the following steps:
(
u an Invoke s into Scope_fulfillment and drop it after the
nactivity
z z
a) Drag
li c e
a ye Transform_fulfillment activity. Rename the Invoke activity to
i l p Invoke_fulfillment.
sh b) 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
b le
fer a
ans
n - t r
a no
c)
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
e) ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
Configure
z z e n
u thecAssign_fulfillment_status Activity
e
TheyFulfillment l i
BPEL service returns a shipStatus and carrier response values. In this
p a
il section you configure the Assign activity to copy the shipStatus from the
sh 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y
13) Save the changes to your z
e BPEL sprocess
e and project.
a u
hilp completed
Note: You havesmostly
( e to the main end-to-end flow for the ApproveCCOrder
z z c e ns enables you to construct the core flow pattern for the
u next practice
process. The
e BPELli process. After this lesson’s practices, you update and change the BPEL
Fulfillment
y
a
ilpprocess flow (and composite application) implementation to include business rules and
sh human workflow patterns where applicable.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s
To complete these ilp perform
htasks e to the following steps:
( s
u cencomposite.xml
e z
1) In thez i
POProcesing
l window, double-click the Fulfillment BPEL
y
ilpa
Process component icon, to open it in the BPEL Editor.
sh Create and Configure JMS Adapter Partner Links
2) In the Fulfillment.bpel Design window, create a JMS Adapter partner link
using the following steps:
b le
fer a
ans
n - t r
no
b) In the Fulfillment.bpel Design window, drag the JMS Adapter from the
a
) has ideฺ
Component Palette into the right-hand Partner Link column.
Note: This opens the Adapter Configuration Wizard window.
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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 le
b) fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
c) zzu c e n
ye l i
i l p a
sh
b le
fer a
ans
n - t r
a no
e)
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this icon ( ) to display the Type Chooser
h) On the Messages page,
y z click the Browse
ethe ShippingRequest
e
a
where you can select
p u s element from the
i
h se l t o (either nested in the fulfillment.xsd or the
s
internalorder.xsd
(
u Schema
Project nFiles folders):
z z l i c e
a ye
i l p
sh
b le
fer a
ans
n - t r
a no
i)
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
5) In the Fulfillment.bpel Design yawindow, d
tuconfirm that the partner link for the
@
u thi
JMS Adapter exists in the Partner Link s S
column the right-side of the window.
e z z
a y u s e
( s hilp se to
z z u cen
ye li
a
ilp6) Click on the POProcessing composite.xml window, and observe that a wire has
sh been created between the Fulfillment BPEL Process component icon and the newly
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
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o
Note: The Fulfillment BPEL Process component
o hasethreen wires, where each wire is
ya reference. d
tu Remember, you could have also
linked to a different JMS adapter external
@
u Adapters s S
created and configured the
e z zJMS
e t hi as external references in the
composite.xmlaand
p y wireduthem
s to the Fulfillment BPEL Process component to
l
i et
yield the samehresults. o
u ( s n s
z z c e
Addea Switchli to Choose the JMS Adapter for the Shipment Request
a y
sh ilpIn this section you create the activity sequence in the Scope_shiporder that uses a Switch
with three <case> 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
m Ginuthe Scope_shiporder
cosequence
Note: Only if you require help to create theoflow ฺ n t
activity, perform the following steps: ho e
y a Stud
a) Drag a Switch activity as u
z @first activity
the
h is in Scope_shiporder.
z t
eactivity sSwitch_shiporder.
e
b) Rename the Switch a y u
c) Expand(s
lp to activity.
hiSwitch_shiporder
the e
uthe left cofethensSwitch_shiporder activity icon, click the Add Switch Case icon
d) z z
To li
a ye ( ) twice to create two new <case> branches:
i l p
sh
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh Note: Only if you require help to build the expression, use the following
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s h ilp e to
17) Configure ( ns <case>
third right-most
uservice branch name and condition expression for the
e z
FedExz li c
byeperforming the following steps:
y
sh ilpa a) On the middle <case> branch, double-click the text “<case>” shown in the title.
b) 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:
b le
fer a
ans
n - t r
a no
18) Save the changes to your Fulfillment BPEL Process, after
h s ฺthat your
averifying
Switch_shiporder activity appears as shown in the m
o
)
following u ide
image:
o o ฺc nt G
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
u names
Note:zThe
z c e n USPS, and FedEx (as specified in each of the Switch Case
UPS,
l i
e now appear as visual annotations in the title for each <case> branch.
ysettings)
il p a
sh Create 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y
Note: Only if you require
z
e help toscreate
e the variable, perform the following steps:
a u
s hilp sScope_shiporder,
a) On the(expanded e to click the Variables icon ( ).
u n
e window, click the Create icon ( ).
Inzthe Variables
b)ez l i c
a y
i l p c) In the Create Variable window, perform these steps:
sh 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.
b le
fer a
ans
n - t r
no
21) Configure the Assign_shiporder, with three copy operations to initialize the contents
a
(and their associated screenshots as a guide): ) has ideฺ
of the shippingAddress variable (in the Scope_shiporder). Use the following steps
c o m Gu
a) Create a copy operation that copies the o
o ฺ n t in the inputVariable to the
orderId element
h
a variable:
orderId element in the shippingRequest ud e
y S t
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d
ya the following
tu XML Fragment into the
c) Create a copy operation that @ copies s S
e
shippingAddress elementz zuof the shippingRequest
thi variable:
a y u s e
h i lp t o
(s nse
<ns0:shippingAddress
u
e z z l i e
xmlns:ns0="http://www.example.org/ns/fulfillment">
c
a y <ns0:street></ns0:street>
i l p <ns0:city></ns0:city>
sh <ns0:state></ns0:state>
<ns0:zip></ns0:zip>
<ns0:country></ns0:country>
</ns0:shippingAddress>
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u fragment h is the XML Namespace prefix and its
Note: When copying z
an XML t
erequired stoepreserve the BPEL process source XML structure.
a y u
h i lp
associated path are
t o
(s tonyour
22) Save the changes
u se BPEL Process.
z lic
ez and Configuree
y
Create the <case UPS> Branch Activities
sh ilpa
In this section, you create an Invoke activity to invoke the UPSJmsService and Assign
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
b le
fer a
a n s
n
24) Configure the Invoke_UPS activity to execute the Produce_Message operation
r
-t of the
UPSJmsService, and use the Automatically Create Input Variable
o
nicon to create a
a
local variable, by performing the following steps:
) has ideฺ
a) Drag a line from the Invoke_UPS activity to o
c mUPSJmsService
the
G u
o ฺ t
o the Automatically
n
b) In the Edit Invoke Activity window,hclick
a Swindow d e Create Input
u ensure the Local Variable
Variable icon, and in the CreateyVariable t
u@ this
option is selected. ClickzOK.
z
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
25) Configure the Assign_toUPS activity with the following three copy operations:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
b) Append the literal string ' (UPS)' h o o the
including e nleading space to the custName
ya Stu d
element in the Invoke_UPS_Produce_Message_InputVariable.
Note: Appending the z z
carrier
@ is customer name is included here so that
u text ttohthe
you can see the a y e used sinethe shipping message received by the JMS message
carrier
consumerh i lp
application t o
that
uyou use in the testing section of this practice. In this
(sthe following
caseuuse n se steps to create an Append Operation:
z e
c window, click the Create icon ( ) and select Append
a yezi) In theliAssign
i l p Operation.
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y z
e expression
e '(UPS)' into the carrier element in the
c) Copy the literalastring u s
process(s hilp se to
outputVariable.
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
26) Save the changes to your z z
BPEL
@
u Process.h is
e e t
a y u s
hilp se the
Create and Configure
( s to <case USPS> Branch Activities
z z u youccreate
In this section,
e n an Invoke activity to invoke the USPSJmsService and Assign
with
y emultiple l
copy i operations preparing the JMS service request message. In the same
a
ilpAssign activity create copy operations to set 'USPS' as the carrier and 'completed'
sh as the status 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
b le
fer a
ans
n - t r
a no
) has ideฺ operation of the
28) Configure the Invoke_UPS activity to execute the Produce_Message
USPSJmsService, Use the Automatically Create c m Variable
oInput G u icon to create a local
o o ฺ n t
variable, by performing the following steps:
h d e
a) Drag a line from the Invoke_USPS
@ ya activity
S tuto the USPSJmsService
zu window, s
thiclick the Automatically Create Input
e z
b) In the Edit Invoke Activity e
yin the Create
Variable icon,
i l p a
and
t o us Variable window ensure the Local Variable
h sClick
option(issselected. e OK.
z u e n
y ez lic
sh ilpa
e z z copy
activity create
l i c eoperations to set 'FedEx' as the carrier and 'completed' as the
y
status in the outputVariable.
sh ilpa
31) Inside the <case FedEX> branch, create the sequence of case-sensitively named
activities listed in the following table:
Activity Type Activity Name
a. Assign Assign_toFedEx
b. Invoke Invoke_FedEx
b le
fer a
ans
n - t r
a no
) has ideฺ operation of
32) Configure the Invoke_FedEx activity to execute the Produce_Message
the FedExJmsService, and use the Automatically c m Input
oCreate G uVariable icon to create
o
a local variable, by performing the following
ฺ
o steps: en t
y h
a activityt utodthe FedExJmsService
a) Drag a line from the Invoke_FedEx
u@ this S
z z
e window,
b) In the Edit Invoke Activity
a y u s e click the Automatically Create Input
Variable icon,
h i lpand in the
t o Create Variable window ensure the Local Variable
option(issselected.sClick
e OK.
z u e n
y ez lic
sh ilpa
35) Save the changes to your BPEL Process and the POProcessing project.
ฺ com nManager
2) In a Web browser window, enter the OracleoEnterprise t Gu URL
http://localhost:7001/em. If required a h owith Username:
login de weblogic with
y t u
Password: welcome1.
z u @ his S
ezManager e t
a y
3) On the Oracle Enterprise s home page, locate and click the deployed
u application link (located under the SOA tree in the
lp composite
“POProcessing i[1.0]”
h t o
(s pane).
Farm navigation
u n se
z lic e
ezthe “POProcessing
4) yOn [1.0]” page, click Test.
ilp a
sh Test 1: Order with a Valid Credit Card and two_day Ship Method
For this test you use the D:\labs\files\xml_in\po-small-ipod.xml file as
input.
5) To run the first test, perform these steps:
a) In JDeveloper, select File > Open and select the
D:\labs\files\xml_in\po-small-ipod.xml file. First copy all the
text in the file into the clipboard, and then close the po-small-ipod.xml
window.
b) On the “POProcessing [1.0]” page in the Web browser, in the Request tab Input
Arguments section, select the XML View, and paste the clipboard contents into
the text area. Click Test Web Service.
c) On the Response tab, click the Launch Message Flow Trace link.
6) On the Flow Trace page, under the Trace section examine the Trace Flow. Answer
the following questions:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
a Stinformation
u d
The child element containing @ theyvalidation is the <inp1:status> element,
and the value returnedziszthe
s
u stringthvalue
i VALID.
a y e s e
i lp
7) Close the Web browser window
t o u containing the Flow Trace, Audit Trail or Flow
h
(s nse
tabbed page.
z z u c e
e l i
y the Shipping Request from the JMS Message Queue
Read
sh ilpa
The Shipping Request JMS message is still retained in the JMS queue until a JMS
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:
b le
fer a
c) In the Running:JmsSendReceive.jpr – Log” window, to terminate the
ans
Receive.java application, at the Input prompt press q and then Enter. n - t r
d) Close the Running:JmsSendReceive.jpr window. a no
) h as eฺ
Deploy a Supplied JMS Consumer Composite
o m Application
u id
To simplify management and handling of JMS o ฺ c
message n G
t and consumption during
delivery
h o e
y t ud
a SJMSConsumerDemo
the rest of the practices, you deploy the supplied project, which is a
composite application that:
z @ his
uproduced
• Reads the JMS messages e z e t by JMS Adapters in the POProcessing
a y
composite application. u s
h i lp request
t o
• Writes(the
u s nse
shipping JMS message to a file called shiporder_#.xml, where
#zrepresents aenumber that is incremented for each message file created. There is
y e z
one lic file per message and the files are stored in the D:\temp folder.
message
sh ilpaThe following image shows the component assembly model for the JMSConsumerDemo
composite application:
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s
the credit hilpwas
The Fulfillment
card
was not
s e
not
oinvoked by the ApproveCCOrder BPEL process because
tvalid and Switch activity that checks the
z u e n
z
yetabbed lic
ValidateCCService response executed the <otherwise> branch, as seen in the Flow
page for the ApproveCCOrder BPEL component link:
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d
a Stu activity is “invalid credit card” as
c. The status value returned by@theycallbackClient
z z u ofththeiscallbackClient activity in the Audit Trail
seen in the expanded <payload>
e e activity.
theyApproveCCOrder
tabbed page for a s
u
( s hilp se to
z z u cen
ye li
ilp a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
a) To which JMS Adapter service washthe o oorder shipping
e n request sent?
ya Stbelow d
u the Fulfillment BPEL
b) Why is the JMSConsumer_ep @ entry shown
u Trace? s
Component entry in the
e z zFlow
e thi
p ay o and
c) Why are theilRouteOrder usthe associated FulfillmentFileService components
inh
present(s
t
z u e seTrace?
the Flow
n
lic
yd)ezWas a shiporder_#.xml file created in the D:\temp folder?
i l p a
sh Step 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
The goal of this practice is to learn how to use the following BPEL activities:
• The Flow activity to execute sequences in parallel
• 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
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z
Note: Part u2 depends c e n the completion of part 1 tasks. If you do not have enough time,
on
l i
yeconsider deploying the solution projects from the POApplication.jws
then
p a
il workspace in the D:\labs\soln\lesson09\POApplication folder for part 1
sh services and composite applications. The changes you make to the POProcessing
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
yaby performing
2) Deploy the InternalStoreSDO project, d
tu the following steps:
@ s S
zu clickththe
a) In the Application Navigator,
e z i Application Menu and select Deploy >
y s e
InternalStoreSDO_InternalStoreSDOProfile
a u > to > soaserver
l p
hi se t o
(
u cens
z z li
a ye
sh ilp
b le
fer a
ans
n - t r
a no
b) Expand the InternalStoreSDO_InternalStoreSDOProfile
) hasandideฺ
OnlineStoreSDO_OnlineStoreSDOProfile entries,
c o m andG u that the service entry
verify
o ฺ
points InternalStoreService and OnlineStoreService
o t
n are present, respectively.
h d e
@ ya Stu
z z u this
a y e s e
u
( s hilp se to
z z u cen
6) yTest li
e the InternalStoreService with the Test Web Service tool in JDeveloper. Use the
a
ilp following steps:
sh a) On the Resource Palette, right-click the InternalStoreService entry, and click Test
Web Service.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om while
t G u
Note: JDeveloper displays the following
h o omessage
e n sending the message and
waiting for the response.
y a Stud
z z u@ this
a y e s e
u
( s hilp se to
Inzthe
c) z n
u HTTPceAnalyzer: # window (where # is a message request number) confirm
e l i
y that the response (in the right window pane) displays the ProdId SKU101 and
i l p a Quantity value 5. Use the following image as a guide:
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
c) In the HTTP Analyzer: # window (where
h o o # is a message
e n request number) confirm
ya pane)
that the response (in the right window d
tudisplays the ProdId SKU101 and
@ s S
Quantity value 6. Use the
e z zufollowing
thiimage as a guide:
a y us e
i l p t o
u (sh nse
e z z lice
a y
i l p
sh
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.
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.
b le
fer a
ans
n - t r
no
a) Is the checkStock operation a synchronous or an asynchronous interaction?
a
) has the
b) Which InternalStoreService operation is used to determine available
e ฺ stock
level for a specific product?
c o m Guid
c) Which InternalStoreService operations o
o ฺ be usedntot update stock quantity
can
values in the underlying table? a
y h t u de
z u@ his S
Note: The SOADEMO e t Oracle Database 10g XE instance contains a
zschema ein the
a y
table called INTERNAL_STORE s
u that maintains the product quantity values. You
can use(s
lp Command
hiSQL t o
u
the
n s e Line tool (in Start > Programs > Oracle Database 10g
e z licEdition
Expression
z e menu to start SQL*Plus), or the SQL Worksheet in
a y JDeveloper to query the database table.
i l p
sh Step a.
Answers for step 3
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).
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
e) What does the <case inStock> branch condition
ฺ c omtest,tand
G uwhat are the actions for
each of the condition outcomes?
h o o e n
ya Stu d
Step Answers for step 5
z @
uinvokestthe
h isgetInternalStoreView1 operation.
a. The Invoke_checkinstore
y z
ethe Invokeseactivity to view the settings.
Hint: Double-click
i a
lp accepts o u
Note: Thehoperation
( s e t a product ID as the input message and returns the
product
z s
u ID candenquantity available from the database (INTERNAL_STORE table).
z li
b. yeThe Assign_prodid copies the prodId element from the first product element of the
il p a input structure to the request message used by the invocation of the
sh 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.
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',
'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:
b le
bpws:getVariableData('n') > 0 and fer a
bpws:getVariableData('inStock') = true() ans
n - t r
no
Note: Remember the Assign_initialize has already preset inStock to the value
a
has ideฺ
true() to ensure that you enter the while loop. Use the following image as a guide:
)
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
If you require help create the While conditional expression, perform the following
steps:
a) Double-click the While icon.
b) On the While > General tabbed page, click the XPath Expression Builder icon to
construct the expression.
c) In the Expression Builder window, perform the following actions to create the
expression:
i) Select the BPEL Variable n and click Insert Into Expression.
ii) Enter the text “> 0 and ” (excluding the quotes).
iii) Place the cursor at the end of the text, select the inStock BPEL variable and
click Insert Into Expression.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a Your XPath expression should resemble the following:
sh /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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya“From” u d
tExpression
Note: The simplest way to change the
u @ i s S is to select the digit 1
between the square brackets
position()=$n.aye
zzand replace
e th it with the highlighted text
i l p t o us
12) You require( h moreseAssign activity in the While sequence to decrement the value
sone
u
of thezvariablec ne byna value of one at the end of the loop. Use the following image as
z
yaeguide: l i
il p a
sh
a) Drag an Assign activity as last activity in the Sequence inside the While activity.
b) Rename the Assign activity to Assign_next_n.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z
Note: The “From” Expression
@ is the following example:
ushouldthresemble
y e z e
a u s
( s hilp se to
bpws:getVariableData('n') – 1
z z u cen
li to your BPEL process and POApplication workspace.
e the changes
14)ySave
ilp a
sh Modify 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:
b le
fer a
17) In the ManageInventory.bpel Design window, expand and configure the
ans
- t
Pick_operation to have two onMessage branches and delete the onAlarm branch.
n r
Hint: Click the Add OnMessage Branch icon ( no
) to create an additional onMessage
a
branch. Use the following image as a guide:
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
If you require help to perform this task, performo
c mfollowing
the G usteps:
o ฺ
o branch t
n icon.
h
a) Double-click the first (left-most) onMessage d e
@
b) In the OnMessage Branchuwindow,
ya configure
S tu the following settings:
z thi s
y e z
Partner Link: manageinventory_client
e (Click the Browse icon to select
a u s
h i lp
the partner link)
t o
u (s inputVariable
Operation:
se
checkStock
n
e z z
Variable:
l i c e (Click the Browse icon to select the variable)
a y Click OK.
i l p
sh 19) Configure the second (right-most) onMessage branch to be associated with the
manageinventory_client partner link, the acquireStock operation, and use the
inputVariable. Use the following image as a guide:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh 22) In 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
b le
fer a
ans
n - t r
a no
23) Configure the Assign_checkstock with a copy operation that stores the string literal
has ideฺ
‘check’ in the operation variable. Use the image as a guide:
)
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
25) Save the changes to your BPEL process.
ya Stu d
z @ is
u acquireStock
h
Modify While Loop with e z the
e t Operation Activities
a y u s
The While loop needs
h i lpthe Assign_prodinstock
t o to be executed when the operation=check,
u ( s nse
and different activities when operation=acquire. To make this change you add Switch
e z z the lWhile
activity, into
i c e loop, with a conditional expression on the operation variable and
a y
configure its <case> and <otherwise> branches with appropriate activities for each
p
il operation.
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
c om branch
27) Expand the Switch_operation to structure the ฺ<case> t G uand <otherwise> branch
as described by the following steps: hoo d e n
a) Drag the Assign_prodinstock @ ya Sthe
activitysinto
tu <case> branch.
e z zu add thethfollowing
i
b) In the <otherwise>
a y branch,
u s e activities in the sequence listed:
ilp Assign
i) Drag ahnew
s e toactivity renamed to Assign_updstock.
( s
nInvoke
zii)zu
Drag aic e
new activity renamed to Invoke_updstock.
y e l
sh ilpa
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z eto operation=check and set the conditional
a u s
s
expression(to
ilp that
28) Configure the <case>
hensure
branch
e the
name
to operation variable is equal to the literal string
z z u as shown
'check', c e nsin the following image:
ye li
ilp a
sh
bpws:getVariableData('operation') = 'check'
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
theliAssign_updstock with the following two copy operations:
ye
30) Configure
a
sh ilp
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s h ilp e to
Note:
u (
To set then scorrect XPath expression for the nth product, perform the
z z c e
a ye followinglisteps in the “From” section:
i l p i) Select the Type as Variable.
sh 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
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
Return z z u acquireStock
the c e n Response Message
y e l i
ilpa
In this section the final change you make to the ManageInventory BPEL Process is to
sh create one more Switch activity to manage the different responses sent to the client using
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o
oconfigure e n<case> branch conditional
33) Expand the Switch_response activitya and d the
u to the literal string ‘check’. Use
yvariableSistequal
@
expression to check if the operation
zu thi s
y e z
the following image as a guide:
e
a u s
( s hilp se to
z z u cen
ye li
ilp a
sh
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @ is to invoke the manageinventory_client
u thactivity
z
36) Configure the callbackClient_fulfilled
ye use
partner link with p theaacquireStockResponse callback operation and use
i l t o
u (sh as Input
outputVariable
n s evariable. Use the following image as a guide:
e z z lice
y
sh ilpa
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
38) Close the ManageInventory.bpel ya window d
tuand the InternalStore
@ s S
composite.xml file. Save
e z zuchangesthtoi your BPEL process and POApplication
workspace.
a y u s e
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
an s
Note: The difference in the OnlineStore, as compared to InternalStore assembly mode, is
- t r
that the external reference is for the OnlineStoreService (another ADF-BC server that you
n
no
deployed earlier in these practices). The OnlineStoreService queries and manages data in
a
the ONLINE_STORE database table.
) has ideฺ
To complete this task perform the following steps:
ฺ c om t Gu
h o o e n
1) Open a Windows Explorer window, and
yafolderStotthe
copy the
u d
D:\labs\files\OnlineStore @ s
zu thi folder.
e z
D:\labs\mywork\POApplication
y e
a u s
2) In the JDeveloper
s h ilpwindow,
e toopen the OnlineStore project in the POApplication
(
workspace by using
u centhe s following steps:
z z li
a ya)e Application
In the Application Navigator, with the POApplication selected click the
il p Menu and select Open Project.
sh b) In the Open Project dialog box, navigate to the
D:\labs\mywork\POApplication\OnlineStore folder, select the
OnlineStore.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.
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', b le
'/ns2:StoreRequest//ns2:product/ns2:qtyOrdered') < 0 fer a
a n s
This XPath expression eliminates the need to loop through all the product n -t r
qtyOrdered
elements. This approach was chosen because when you add the FlowN
o
nactivity to process
a
multiple products you need an array of elements to track which
) h asproducts
e ฺ are in stock. It
does not makes sense for multiple FlowN branches to m
o id (single) inStock
update a solitary
u
o ฺ c
variable as was done in the While loop of the InternalOrder
n G
composite
t BPEL
o
a Sbytuthedeactivities
implementation, otherwise the results couldhbe incorrect depending on the order of flow
@ y
branch processing and the outcomes determined performed.
u i s
y e zzarray eof product
th elements already present in the
Therefore, you make use
i
inputVariable to trackl pthe
of the
t usfor the acquireStock update operation in addition to
a newovalue
(stoh determine
using the values
u n se if products are out of stock for a checkStock operation.
e z z l ic e
y
Implement a FlowN Activity to Products Multiple Products
sh ilpaIn this section, you modify the ManageStock BPEL process by creating a variable n of
type xsd:int that is initialized with the number of products in the inputVariable. In
addition, you add a FlowN activity with a Sequence that contains activities from
Assign_prodid to the Switch_acquirestock activities (inclusive). You then modify the
Assign activity copy operations in the FlowN sequence to use the FlowN index variable
to access the nth product element for each FlowN branch.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
h i lp
6) In the ManageStock.bpel
t o Design window, drag a FlowN activity before the
(s nsactivity.
Scope_stockprocess
u e Use the following image as a guide:
ez z lic e
y
sh ilpa
7) To edit and configure the FlowN_1 activity settings, double-click FlowN_1 activity
icon and perform the following steps:
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilpenter
Alternatively,
e
theto
following expression into the N field:
z z u cens
ye li
count(bpws:getVariableData('inputVariable', 'payload',
i l p a '/ns2:StoreRequest/ns2:product'))
sh b) 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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u activity
h is expands when your drop it into the
z
Note: The Scope_stockprocess t
eimage sshows
e the scope in a collapsed state for readability.
sequence above. a y
The u
( s hilpto your
e to process.
z z u cens
10) Save the changes BPEL
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
12) In the ManageStock.bpel
y z
e Design e window, double-click the Assign_newqty
a u s
( s hilp and
activity and modify
“From” Expression
the copy
s ethe
operation by replacing the [1] string in, both the
to“To” XPath expression, with the [position()=$n]
z u e n
y ez Use thelicfollowing image as a guide:
string.
sh ilpa
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d
a Stu windows, and save all
ycomposite.xml
14) Close ManageStock.bpel and
z @
u this
changes.
y e z e
a u s
( s hilp se to
z z u cen
ye li
ilp a
sh
has ideฺ
Note: Monitor the “Deployment – Log” window to ensure deployment is successful.
)
Note: Now that the composite applications are deployed,ฺ c om if tyouGtrust
u that you have
o
correctly and successfully created the InternalStore
h o andeOnlineStore
n composite
applications, to save time you can skip y a rest ofSthis
the t d
u practice and start with instructions
for the practice titled “Add a Flow
z z u@ t h is
to the Fulfillment BPEL Process” in this lesson.
e
y and e
Query the InternalStore
i l p a
t o usOnlineStore Database Tables
In this section
u shperform
(you n setwo SQL queries to view the existing stock for three of the
products
e z
z the database e
lic tables for the InternalStore and OnlineStore. The database tables
y
ilpa
queried are called INTERNAL_STORE and ONLINE_STORE, respectively.
sh 4) In the JDeveloper window, execute a query on the INTERNAL_STORE database
table to check the available stock for the following three product IDs: SKU101,
SKU102, and SKU200. Use the SQL statement in the file called
D:\labs\files\int_store_query.sql in the following steps to perform
this task:
a) On the JDeveloper Application Menu, select the files application name.
Note: If the files application is not open, select File > Open, browse for and
open the D:\labs\files\files.jws file.
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
10) On the “InternalStore [1.0]” Test Web Servicecpage,
ฺ omunder t G uRequest tab Input
the
Arguments section, select the XML viewo
h o replaceenthe XML data with the contents
and
y a Stud
of the file D:\labs\files\xml_in\prod-in-store.xml, and click Test
Web Service. @ s
zinuthe filesth>i Application Sources > xml_in folder in the
Note: You can find this y e z
file e
a u s
hilp senavigator
JDeveloper Application
( s to window with the files application selected.
a) On
z z uthe Response
c e n tab, click the Launch Message Flow Trace link.
l i
yb)e On the Flow Trace page, click the ManageInventory BPEL component link.
il p a Note: You might need to refresh the page until you observe the following results
sh 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.
b le
fer a
a n s
ii) Optionally, if you are interested, expand other flow activity entries
n r
-t to examine
the flow execution sequence, and verify that each time the n o
InternalStoreService is invoked with each product a
a
Idssupplied in the
inputVariable. ) h ideฺ
d) Close the Flow Trace Web page, and return ฺ c om
to the t
TestG u
Web Service page.
h o o e n
11) On the “InternalStore [1.0]” Test Weby aServiceS t ud click the Request tab again, and
page,
modify the qtyOrdered element
z z u@ t h s second product (prodId value SKU102)
value inithe
a y e Test Web
to the value 10, and Click s e Service. For example:
u
( s hilp se to
z z u cen
ye li
ilp a
sh
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.
b le
i) What is the response in the status element of the callback? fer a
Answer: It should be out-of-stock, as shown in the following image: an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
a ye Note:liFor a degree of simplicity in the application scenario, the BPEL process
i l p reports an out-of-stock status if any one of the ordered products cannot be
sh 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 b le
D:\labs\files\xml_in\prod-in-store.xml file, and click Test Web fer a
Service. ans
n - t r
a) On the Response tab, click the Launch Message Flow Trace link.
a no
has ideฺ
Note: In the Flow Trace tree there should be six rows of the InternalStoreService
present. )
b) On the Instance of ManageInventory Audit ฺ c ompage,
Trail t G u
scroll down and expand
h o o activity
the <payload> for the callbackClient_fulfilled e n at the end of the flow.
d
yaelementSoftuthe callbackClient_fulfilled?
c) What is the response in the
z @
status
u thiass shown in the following image:
Answer: It should be
y e z e
fulfilled,
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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:
b le
|
fer a
ans
Note: The product quantities should be less than 5 for each of the listed products.
- t
There should be two SKU101 products available, three SKU102 products, and
n r
four SKU200 products.
a no
c) Close the int_store_query.sql window.
) has ideฺ
Test the OnlineStore checkStock Operation ฺ c om t Gu
h o o e n
15) On the Oracle Enterprise Manager y a home
SOA d
u expand the SOA folder in the
tpage,
@ s S
Farm navigator, and click the
e z zu“OnlineStore
thi [1.0]” link.
16) On the “OnlineStore a y page,
[1.0]” e
usclick Test.
i l p t o
( sh ns[1.0]”
17) On the “OnlineStore
u e Test Web Service page, ensure that the Operation selected
ez z
is checkStock, e
for
lic example:
y
sh ilpa
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.
b le
i) What is the response in the status element of the callback? fer a
Answer: It should be in-stock, as shown in the following image: ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a ii) Optionally, if you are interested, expand and examine the flow created by the
sh FlowN activity. Verify that each branch of the FlowN processes a different
product Id supplied from the inputVariable.
d) Close the Flow Trace Web page.
b le
fer a
ans
n - t r
no
a) On the Response tab, click the Launch Message Flow Trace link.
a
h a s ฺ link.
b) On the Flow Trace page, click the ManageStock BPEL component
Note: The OnlineStoreService reference row appears
o m de
) threeuitimes.
o o ฺc nt G
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh 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. What is the
response in the status element of the callback?
Answer: It should be out-of-stock, as shown in the following image:
b le
fer a
ans
c) Close the Flow Trace window.
n - t r
no
21) In the JDeveloper window, execute the SQL statement to verify that the quantity
a
has ideฺ
values for the products ordered from the ONLINE_STORE database table have been
)
decreased. Use the following steps:
ฺ c om t Gu
a) In the Application Navigator, in the files
h o o application
e n under the files >
Application Sources > sql folder, d
yaand right-click
tu onl_store_query.sql and
select Open. Alternatively, @
u thi s
double-click
S
the file name.
e z z
a y
b) In the onl_store_query.sql u s e window, click the Execute Statement icon
( ), and s ilp anyeoftothe soademo connections. Verify that you obtain the
hselect
(
u results
following nsin the Results tab:
z z li c e
a ye
i l p
sh
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.
b le
fer a
ans
n - t r
c) Close the onl_store_query.sql window. a no
s ฺ
hafrom
o m )
23) In the Application Navigator, select POApplication name
u deapplication pull-
ithe
down menu.
o o ฺc nt G
y ah Stude
z z u@ this
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp sande OnlineStore
Note: The InternalStore
to composite applications are asynchronous. For
z
brevityzthe ufollowing c e n
activities are not illustrated in diagram within the Switch:
e l i
y• The Assign activities that prepare requests for the invocation of the acquireStock
sh ilpa operations.
• 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.
h o o
My Role: Select ManageInventoryRequester
e n
ya Stu
Click OK. d
d. Fulfillment.bpel
z @
Verify that the InternalStore partner link icon has
u this
Design
y e z been added into the right-hand column.
e
a u s
a)
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
c) ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
d)
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
c) h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
d)
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
y a Stu
11) First, to configure the Invoke_internalstore d
activity, double-click the
Invoke_internalstore activity and
z u @ his
associate it with the InternalStore with the
checkStock operation.zEnsure thatt you use the Automatically Create Input
a y ea Local Variable.
s e Use the following Create Partner Link
Variable icon to create u
( s hilp se to
image as a guide:
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s hilp se to
b) In the Transformation_internalstore.xsl
( window, expand the source
u
z and
column
z c n
e the item element to the product element in the target column.
drag
y e Use the l i
following image as a guide:
i l p a
sh
c) In the Auto Map Preferences window, accept the default settings and click OK.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ
e) Save the changes to your project, and closec om t Gu
the
h o o e n
ya Stu
Transformation_internalstore.xsl d window.
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
15) Save the changes to the y z
eFulfillment
eBPEL Process.
a u s
s hilp seintthe
Configure (Activities
o Flow Branch for the Online Store
z z u in the c e n
In this section, l i right branch of the Flow activity you create an asynchronous
ye pattern using an Invoke with the OnlineStore checkStock operation, and a
invocation
a
p
il Receive with the checkStockResponse operation. You also create a Transform activity to
sh prepare the 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
b le
fer a
ans
n - t r
a no
) has ideฺ
17) To configure the Invoke_onlinestore activity, ฺ c om t GtheuInvoke_onlinestore
double-click
h o o with theencheckStock operation.
activity and associate it with the OnlineStore
y ud Variable icon to create a Local
aCreateSInput
t
Variable. Use the followingz z u@ Partner
Ensure that you use the Automatically
Create t h is Link image as a guide:
a y e s e
u
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d
ya Stu window, expand the source
z @
b) In the Transformation_onlinestore.xsl
uelementthtoisthe product element in the target column.
column and drag the item
y e z e
a u s
( s h lp sPreferences
c) In the Auto iMap
e to window, accept the default settings and click OK.
d) In the
z z c e n
u Transformation_onlinestore.xsl window, expand the source
ye and l
target ielements and verify your mapper file resembles the following image:
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilpto the
21) Save the changes
s e to
Fulfillment BPEL Process.
b le
fer a
ans
23) Configure the left-most Switch Case settings to check the response in the
n - t r
following steps: a no
Receive_internalstore_checkStockResponse_InputVariable by performing the
) as branch.
h<case> e ฺ
a) Double-click the <case> title section on the left-most
om t Gu i d
o ฺ c n
h o d e
@ ya Stu
z z u this
a e window,
ysettings se set Name to internalstore=in-
b) In the SwitchpCase u
l an Expression
to
stock(s hibuild
and
s e that compares the status element in the
u
z lice n
Receive_internalstore_checkStockResponse_InputVariable
z with the string 'in-
y e stock'. Use the following image as a guide:
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @ is steps:
u the following
h
For additional instructions,
e z use
e t
p a
a) To create activities
y u s
h i l in the
t o <case internalstore=in-stock> branch perform the
(s steps:nse
following
u
e z z i
i) Drag lan c e activity into the left <case> branch and rename it to
Assign
a y
i l p Assign_acquireinternal.
sh 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.
29) To configure the Assign_acquireinternal, create two copy operations using the
following steps:
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya theSliteral
b) In the second copy operation, assign d
tu string 'completed' to the
z @
u thi
shipStatus in the outputVariable. Usesthe image as a guide:
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s hilpto the
31) Save the changes
( s e to
Fulfillment BPEL Process.
z u
z lice n
y e
Configure Activities in the <case onlinestore=in-stock> Branch
p a
il In this section, you configure the Invoke_acquireonline to use the acquireStock operation
sh 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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
z
33) To configure theilp aye o use create two copy operations using the
Assign_acquireonline,
s h se t
following (steps:
z z u cen
ye li
ilp a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
b) In the second copy operation,
z @
u assign h s literal string 'completed' to the shipStatus
ithe
in the outputVariable. z t
e Use theseimage as a guide:
a y u
h i lp t o
u (s nse
e z z l i c e
a y
i l p
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilpto the
35) Save the changes s e to
Fulfillment BPEL Process.
z u e n
y
Configure lic
ez Activities <otherwise> Branch
p a
il In this section, you configure the Assign_waiting activity in the <otherwise> branch to
sh update the shipStatus in the outputVariable to indicate the order is not shipped because
neither store has items in stock.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
@
zu Design h iswindow verify that the Switch_selectstore
z
37) In the Fulfillment BPELeProcess e t
activity resembles a
they u
followingsimage:
( s hilp se to
z z u cen
ye li
ilp a
sh
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.
b le
fer a
ans
n - t r
a no
b) In the Fulfillment.bpel Design window, select thes“<case onlinestore=in-
stock>” branch. ) ha ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
li
yc)e In the Fulfillment.bpel Design window, at the bottom-left side of the
i l p a window click the Source tab.
sh
i l p a <case> branch the Source window automatically expands the code and you can
sh verify that the “<case
condition="bpws:getVariableData('Receive_internalstore_...” line appears
immediately after the “<switch name="Switch_selectstore">” element:
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
c o m Gu
o ฺ n t
c) Drag the Scope_shiporder into the <caseoorder completed?> branch. Use the
h d e
following image as a guide:
@ ya Stu
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh 43) Save changes to the Fulfillment BPEL Process.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh 9) On the Flow Trace, verify your answers by clicking the Fulfillment BPEL
Component 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?
b le
fer a
an s
n - t r
no
In the Web browser window that is opened you can view the response message:
a
) has ideฺ
ฺ c om t Gu
h o o e n
d
yaresultSreturned
tu from the InternalStore is
b. The result return is in-stock.@ The
u thi s
zReceive_internalstore
y z
determined by clickingethe e activity icon. In the Activity
a s
u xml document” link:
Details window,lpclick the “View
h i t o
u (s nse
e z z l i c e
y
sh ilpa
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y z
e display ethe updated stock quantity levels for the internal
a
10) In the JDeveloper window, u s
( s hilpby sperforming
and online stores e to the following steps:
a)ez
u cen
Inzthe ipod_query.sql
y li window, click the Execute Statement icon ( ), and
ilpa
verify that you obtain the following results in the Results tab:
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
f) On the Web page that is opened the response from the online store is in-stock
f er a
for example:
an s
- t r
n on
s a
) a
h ideฺ
c m Gu
opage,
13) On the JDeveloper ipod_query.sql tabbed
o ฺ
ohas reduced t the Execute Statement
click
n
h e
a Stud the product quantities by a
icon and confirm that the ONLINE column
value of 5 for the two products @ y
SKU303 s and SKU304 from 8 and 7 to the values 3
z u
z following
and 2, respectively. Useethe h i
t image as a guide:
a y u s e
h i lp t o
u (s nse
e z z l i c e
y
sh ilpa
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a Answer: If you examine the rows under the Fulfillment BPEL Component you can
sh see that there is no instance for a JMS Adapter service. This indicates the order was
not 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.
b le
fer a
ans
n - t r
no
b. The response received from the online store is out-of-stock, as expected. To
a
) has ideฺ
view the response, on the Audit Trail tabbed page scroll down and click the “View
XML Document” link that appears below the Receive_onlinestore activity. For
example: ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
The following XML response message is displayed in another Web page:
b le
The following XML response message is displayed in another Web page:
fer a
an s
n - t r
a no
) has ideฺ
d. No. The quantities for the product with the ID of
ฺ c om t G u not been changed.
SKU305 have
Note: The po-large-ipod.xml order
h o orequestedena quantity of 20 for the product
with ID of SKU305. Neither storeyhasa enough t d to fulfill the order.
uquantity
u@ this S
e z z
a y u s e
( s hilp se to
z z u cen
ye li
ilp a
sh
b le
fer a
an s
n - t r
a
commit the database changes performed by the UPDATE statements.
no
d) In the ipod_update.sql window, click the Commit icon or press F11, to
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
e) In the ipod_query.sqly e z e click the Execute Statement icon ( ), and
window,
a u s
s
results(in hthe pResults
select any ofilthe to connections. Verify that you obtain the following
soademo
e
z z u cens tab:
ye li
i l p a
sh
b le
fer a
an s
The changes to the assembly model include: n - t r
• Create the CheckCCLimit BPEL Process component a no
BPEL Process components. ) has ideฺ
• Create new wire between the ValidateCreditCard Mediator and CheckCCLimit
ฺ c om t Gu
• Create a new wire between the CheckCCLimit BPEL Process and
h o o e n
CreditCardDBService.
ya Stu d
Note: When creating new wires from the Mediator component you also need to create
z @
u this
new transformation files. In this case, you also configure filters to ensure you direct the
y e z e
a u s
appropriate cards to the correct target service.
s h ilp e to
You createu ( ntosget theBPEL
the CheckCCLimit Process implementation to invoke the
e z z li
CreditCardDBService c e credit card status and its credit limit, and check if the
y
ilpa
order total exceeds the credit limit. This is illustrated in the following image:
sh
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya theSfault d
tu and sets the order status in the
The ApproveCCOrder BPEL process handles
@
zuto indicate s
outputVariable response message
e z e thi the order is rejected.
p a y us
i l t o
u (sh nse
e z z lice
y
sh ilpa
) has ideฺ
To complete this task perform the following steps: om u
ฺ c t G
o theePOApplication
n
1) In the JDeveloper Application Navigator,
a h oensure d is the selected
application. y S t u
z u@ h i s
a y ez se t
i lp t o u
h
(s nse
z z u c eApplication Navigator, if needed expand the CreditCardValidation
2) Inethe i
JDeveloper
l
y> SOA Content folder and double-click the composite.xml to open the assembly
sh ilpa model in the Composite Editor window.
3) In addition, open the ValidateCreditCard.wsdl file in the WSDL Editor and
answer the following questions:
a) What is the name of the fault for the validateCC operation?
Hint: Expand the validateCC operation node in the validateCC_ptt tree under the
Port Types column, and select the fault node. The fault name can be found in
Property Inspector, which may require you to click View > Property Inspector to
be visible.
b) What is the message name for the fault? Find two places where you can determine
this information.
c) What are the fault message type and part names?
d) Where can you find the definition of the fault message type name, and what leaf
child element name in the fault message type structure?
Hint: Click the Imports button in the WSDL editor.
b le
fer a
ans
n - t r
no
Note: To ensure the Property Inspector is visible, select View > Property Inspector.
a
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
With the Messages section expanded and theฺc omselected
fault t G u
in the Port Types section,
the message name and its definition ish o o in theeMessages
visible n section:
y a t u d
u@ i s S
z
ez se t h
a y u
h i lp t o
u (s nse
e z z l i c e
a y
i l p
sh
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
b le
definition and child leaf node, which is named “error’:
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
4) Close the creditcheck.xsd and ValidateCreditCard.wsdl windows in
sh JDeveloper.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
c) a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
starts-with($in.request/inp1:CreditCheckRequest
/inp1:CCNumber, '9000')
Note: Enter the expression on a single line. Use the following image as a guide:
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
s h ilp e to
( nssection whose target iswindow, to create the filter expression for
13) In the ValidateCreditCard.mplan
uroutingcrule
the
e z z
first li e
a yCheckCCLimit/checkcclimit_client::validateCC perform the following steps:
sh ilp a) 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'))
b le
fer a
an s
n - t r
a no
c) Save the changes to the Mediator component file.
) has ideฺ
14) In the ValidateCreditCard.mplan window,
ฺ c omcreate
t Gtheurequest message
transformation for the BPEL component by
h o operforming
e n the following steps:
ya Stu d
a) In the request section for the CheckCCLimit/checkcclimit_client::validateCC
@
anuexisting
z h is file or create a new one.” icon ( )
z
target, click the “Select
e containing t mapper
e the text “request: <<Transformation Map>>”
next to Transforma yUsing u s
( s hilp se to
z z u cen
ye li
ilp a
sh
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:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
3) Save the changes to the CheckCCLimit BPEL process diagram.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
5) Save the changes to your BPEL process.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
7) Save the changes to your BPELz @
u process.h is
e z e t
a y u s
h i lp
Configure the Assign_ccstatus
t o Activity
u (s the Assign_ccstatus
8) To configure n se activity, double-click the icon and create a single
z z c e
e operationli that copies the status element returned in the
a ycopy
Invoke_ccservice_CreditCardDBServiceSelect_OutputVariable into the status
sh ilp variable of the process outputVariable. Use the following image as a guide:
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
11) To configure the <case> branch condition,
a Stu
ytitle
performd the following steps:
@
a) Double-click the <case> branch
z s
u thisection.
y z
e window, e set Name to check status and
b) In the Switch Case
a settings
u s
limit. hilp to
( s
u cens e
z z li
a ye
sh ilp
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a Note: The condition should resemble the following expression, showing where
sh 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
b le
fer a
ans
n - t r
13) To configure the Throw_validateccfault activity, using the following image as a
guide:
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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
b le
fer a
an s
n - t r
a no
) has ideฺ
b)
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
b le
fer a
ans
n - t r
d)
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a14) Save the changes to your BPEL process.
sh
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.
b le
fer a
16) To configure the Catch branch to handle the validateCCfault, double-click the Catch
an s
branch icon use the following image as a guide to the settings:
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilpvalue
Note: The “From” e to resemble the following expression (noting the space
should
at thezend
z nsstring literal parameter in the concat function):
u of thecefirst
ye li
i l p a concat('Error: order total exceeds the credit limit of ',
sh bpws:getVariableData('Invoke_ccservice_CreditCardDBServiceSele
ct_OutputVariable','CreditcardsCollection',
'/ns4:CreditcardsCollection/ns4:Creditcards/ns4:creditLimit'))
b le
fer a
an s
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
d
yaReplySactivity
tu settings, perform the following
@
Note: if you require help to create
zu thi
the
s
steps:
y e z e
p a u s
hilwindow,
a) In the Reply
( s e o Partner Link click the Browse Partner Links icon ( ).
tfor
u Partner
b) Inzthe
z c e ns Chooser window select checkcclimit_client and click OK.
Link
ye li
i l p a c) In the Reply window, for Variable click the Browser Variable icon ( ).
sh d) 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.
b le
To complete the task of handling the validateCCfault, perform the following steps:
fer a
an
1) In the JDeveloper Application Navigator, if needed expand the POProcessing project
s
n - t r
> SOA Content tree and double-click ApproveCCOrder.bpel to open it in the
BPEL Editor. a no
) h as eฺ
Create and Configure a Catch Block on Scope_validatecc
c o m Guid
h o oฺ entscope.
In this section create a Catch block on the Scope_validatecc
2) In the ApproveCCOrder.bpel y a window,
Design S t ud create a Catch branch on the
Scope_validatecc scope by z z u@ the
clicking t h is Catch Branch icon ( ) on the scope
Add
y
sidebar. Use the following
a e imagesase a guide:
i lp t o u
h
(s nse
z z u c e
y e l i
sh ilpa
b le
fer a
ans
n - t r
a no
has ideฺ
If needed perform the following steps to create the Catch settings:
c) In the Catch window, for Fault Variable click the Auto-create Fault Variable icon
( ).
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y
6) Save the changes toayour
z
e BPEL sprocess.
e
ilp e to u
( s h
Deploy the
z z c e ns
u POProcessing Composite Application
7) yDeploy li
e the modified POProcessing composite application, by right-clicking the
il p a POProcessing project name and selecting Deploy > POProcessing > to soaserver.
sh Overwrite the existing version and ensure deployment is successful.
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
b) On the Response tab, the reply status o
h o displays
value e n the value VALID. This is
expected. For example: ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
h i lp
a) Why is the CheckCCLimit
t o BPEL Component not showing a Faulted value in the
(s nse
State column?
u
b)ez z i
How can lyouc etell that the validateCCfault business fault has been propagated
a y externally to the composite application?
i l p
sh
You can verify this information by clicking the CheckCCLimit BPEL link:
b le
fer a
ans
n - t r
n o
In the “Instance of CheckCCLimit” Audit Trail page, scrolls a
down and locate the Throw
ha such
activity and observe that the fault is thrown and then )caught,
i d e ฺ the final Assign
that
m Gthe
and Reply activities are successfully executed toopropagate
c u fault message to the
invoker of the BPEL process: o o ฺ n t
h d e
@ ya Stu
z z u this
a y e s e
u
( s hilp se to
z z u cen
ye li
i l p a
sh
b l e
fer a
ans
n - t r
On the “Instance of ValidateCreditCard” Audit Trail page, you can scroll to and locate
the error when the 2-way operation “validateCC” is displayed. After the error is detected
a no
the Mediator performs a transformation of the fault message data received from the
has ideฺ
BPEL process and it performs a step showing “Rethrowing fault” after which the fully
)
fault has been propagated externally. ฺ c om t Gu
qualified QName for the validateCCFault is shown. This action is the indicated that the
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a
sh
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.
Note: If you desire confirm that the response from the ValidationCCService is the
status of VALID.
e) Close the Flow Trace Web browser window.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z e
a u s
( s hilp se to
z z u cen
ye li
i l p a c) On the Response tab, click the Launch Message Flow Trace link.
sh 12) On the Flow Trace page, confirm that the validateCCfault is thrown for the credit
limit being exceeded for this order.
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
z @
u this
y e z ethe Trace tree and answer the following questions:
a u s
13) On the Flow Trace
s h ilp e to
page, examine
a) What (
u is inthethe nsorder status in outputVariable
final supplied to the callbackClient
e z z
activity li c e ApproveCCOrder BPEL process? Explain your answer.
y
sh ilpa b) Was the order processed by the Fulfillment service? Explain your answer.
c) Did the fault message get received by the ApproveCCOrder BPEL process?
b le
fer a
ans
n - t r
a no
) has ideฺ
ฺ c om t Gu
h o o e n
ya Stu d
Note: The reason why theustatus
z @ s set to rejected is because the
has ibeen
h
ApproveCCOrder y BPELz
e process t
e caught the fault condition. In the catch block the
a u s
Assign_rejected
h i lp activity
t osets the status.
u (s nse
b.
eThe
z z Fulfillment
l i c e BPEL process was not invoked by the ApproveCCOrder BPEL Process,
y because it does not appear in the Trace tree due to the Invoke_validatecc activity
sh ilpa receiving the validateCCfault. This caused the Catch block to execute and end the process
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.
b le
fer a
ans
n - t r
a no
h a s ฺ and can be viewed in
Note: However, that the fault message text is not saved anywhere,
) uide
the Audit Trail pages for the relevant component instances.
m
o
ฺc nt G
o o
h tude
y
14) Close the Flow Trace and any Activity
a Swindow you have opened.
z u@ hDetaili s
a y ez se t
i lp t o u
h
(s nse
z z u c e
y e l i
sh ilpa