Professional Documents
Culture Documents
D53946GC20
Edition 2.0
September 2010
D65409
Glenn Stokol
Disclaimer
Technical Contributors
and Reviewers
Akshatha Niranjan
Shay Shmeltzer
Anand Sidgiddi
Sheela Vasudevan
Anirudh Pucha
Stephanie McReynolds
Anjulaponni Azhagulekshmi
Steven Friedberg
Subbiahpillai
Steven Muench
Avijit Borthakur
Bijoy Choudhury
Brian Fry
Clemens Utschig
David McCann
David Shaffer
David Twelves
Deirdre Matishak
Demed LHer
Dhiraj Thakkar
Gangadhar Konduri
Heidi Buelow
Holger Dindler Rasmussen
James Mills
Jay Kasi
Joe Greenwald
John Cobb
Kalpak Kothari
Ken Cooper
Kevin Clugage
Khanderao Kand
Kristopher Rice
Lloyd Williams
Lynn Munsinger
Manoj Das
Mark Kennedy
Melody Yang
Mohan Kamath
Peter Laseau
Prabhu Thukkaram
Prasad Dixit-Hardikar
Prasen Palvankar
Rakesh Saha
Rashmi Menon
Robert LaVallie
Swarnapriya Shridhar
Ted Witiuk
Timothy Gleason
Tom Hardy
Valli Pataballa
Vasiliy Strelnikov
Viktor Tchemodanov
William Prewitt
Trademark Notice
Vikas Anand
Vikas Jain
Yan Jing
Yi Lu
Yogesh Kumar
Yosuke Katsuki
Editors
Arijit Ghosh
Nita Pavitran
Graphic Designer
Rajiv Chandrabhanu
Publisher
Syed Imtiaz Ali
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Author
iii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
iv
Consider the XML tree structure in the following image of JDevelopers XSLT Mapper:
In the sample image observe that each XML element (the tree nodes below the
<sources> root) has an XML namespace prefix, such as imp1: in the image
example. The XML namespace prefix, which maps to an XML Namespace string, is:
Used to uniquely identify (qualify) each XML element
Generated dynamically by the JDeveloper tool that creates the XML structure.
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.
Note: Therefore, the practice instructions do not specify the XML namespace prefixes for
XML elements that you work with, even though the screenshots related to those
instructions contain XML namespace prefix values. The screenshots are provided as
sample and guide. Your job is to ensure that the XML element names and structures
created, mapped, or referenced are correct as documented, and not to be concerned about
different XML namespace values.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you start JDeveloper and create a database connection. To complete this
task, perform the following steps:
1) On the Desktop, double-click the JDeveloper 11g desktop icon to start JDeveloper.
Note: The Oracle Database 10g Enterprise Edition server should already be running.
If you have connection problems, request for assistance from the instructor.
2) In the JDeveloper window, click the View > Resource Palette menu.
3) On the JDeveloper Resource Palette, click the New icon (
Connection > Database.
soademo
soademo
soademo
localhost
1521
XE
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you create an Application Server connection for your SOA Server to
enable you to deploy SOA Composite application projects and other services. To
complete this task, perform the following steps:
1) Start the WebLogic Administration server by double-clicking the Start WebLogic
Admin Server icon on the desktop. Wait until the server is started. You can verify this
when you see the text similar to the following display in the terminal window:
<Jun 16, 2009 12:59:43 AM EDT> <Notice> <WebLogicServer> <BEA000360> <Server started in RUNNING mode>
2) Start the SOA Server (managed server) by double-clicking the Start SOA Server icon
on the desktop. Wait until the server is started. You can verify this when you see the
text similar to the following display in the terminal window:
INFO: FabricProviderServlet.stateChanged SOA Platform is
running and accepting requests
Note: You can ignore the warnings displayed in the command SOA Server command
window.
3) In the JDeveloper Resource Palette, click New icon (
Application Server.
4) On the Create Application Server Connection wizard pages, enter the information
specified in the following table:
Step Screen/Page Description
a.
Create Application Server
Connection Step 1 of 5
b.
Choices or Values
On the Name and Type page enter:
Connection Name: soaserver
Accept default for other items, and click Next.
On the Authentication page enter:
Username: weblogic
Password: welcome1
Click Next.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Choices or Values
On the Configuration page enter:
WLS Domain: soa_domain
Accept defaults for remaining fields, and click
Next.
On the Test page:
Click Test Connection.
Ensure a success result is displayed for all eight
tests, and click Finish.
Note: If you require help to perform this task, refer to the following screenshots for
guidance to the steps described in the preceding table of instructions:
a)
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d)
In this practice, you set some JDeveloper preferences to ensure the settings are
compatible for the work being done in the Oracle University network environment. You
also learn about some other useful settings.
1) To open the JDeveloper Preferences, select Tools > Preferences from the menu.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2) In the Preferences window, perform the following steps to alter the preferences
mentioned:
a) For the Environment preference settings, which is the first set of preferences
shown when you open the Preferences window, locate the Encoding preference
and select UTF-8 from the pull-down box. Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Preferences window, expand the Code Editor preference (the sixth entry in
the navigation tree on the left pane), and click the Line Gutter node. In the Line
Gutter settings, select the Show line Numbers option. Use the following image as
a guide:
Note: Show Line Numbers displays a line number for each line of source code.
This is a useful preference to locate specific lines of code reported for compiler
errors and when various design-time tools detect errors in your application code
or structures.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c) In the left navigation pane, scroll down and select the Web Browser and Proxy
entry. In the Web Browser and Proxy preferences, deselect the Use HTTP
Proxy Server check box. Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you create a WSIL connection enabling you to look up Web Service and
SOA Composite application WSDL URLs from the run-time environment through a
WSIL service application predeployed with the installation of Oracle WebLogic Server.
Note: Before creating the WSIL connection, you should have disabled the Browser and
Proxy settings in JDeveloper Preferences as described in the practice titled Set
JDeveloper Preferences."
To complete these tasks, perform the following steps:
1) In the JDeveloper Resource Palette window, click the New icon (
Connection > WSIL.
) > New
2) On the WSIL Connection wizard pages, enter the information specified in the
following table:
Step Screen/Page
Description
a.
Welcome
b.
Connection Type
c.
WSIL URL
d.
Authentication
e.
Finish
Choices or Values
Click Next.
Accept the default settings.
Click Next.
WSIL File:
http://localhost:8001/inspection.wsil
Click Next.
Username: weblogic
Password: welcome1
Click Next.
Click Finish.
Note: Use the following screenshots if you require guidance through the steps
described in the preceding table of instructions:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
d)
3) To confirm that the WSIL connection is operational, on the Resource Palette expand
the WSIL node and expand the WSILConnection1 entry. You should see two
subfolders called: soa-infra and usermessagingserver, as shown in the following
image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The goal of this practice is to familiarize yourself with the customer order in the po.xsd
XML Schema, and the application internal representation of the order in the
internalorder.xsd. The XSD files are opened with the JDeveloper XML Schema
Editor to enable you to make some comparisons based on questions asked in the
practices.
The following images provide a partial visual representation of the po.xsd and
internalorder.xsd files:
In addition, you examine the CREDITCARDS table data in the soademo database
schema used by the purchase order processing application.
The following image represents the JDeveloper Database Navigator window, from which
you can browse, modify, and create database structures, as well as query and modify the
data they contain:
Note: Familiarization with some of the data and data structures facilitates understanding
the application design and implementation tasks performed in subsequent practices.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you open the po.xml supplied XML schema file using the XML
schema editor. This enables you to view the structure payload of information.
Note: For answers to the questions posed in this section refer to the table of answers at
the end of this practice.
1) In the JDeveloper window, select the File > Open menu and browse for and open the
D:\labs\files\files.jws file.
Note: If the Open Warning dialog box is displayed, at the Do you want to migrate
these files? prompt click Yes. In the Migration Status dialog box, click OK.
2) To examine the purchase order XML schema, perform the following steps:
a) In the JDeveloper Application Navigator, in files project expand the Application
Sources > xsd folders.
b) Double-click the po.xsd file to open the file in the XSD Editor.
c) Expand the OrderItemType and answer the following question: What is the data
type for the price element?
d) Expand the PurchaseOrderType complex type and answer the following
questions:
i) What are the type and values for the payOption element?
ii) What are the name and type of the repeating element?
3) To compare the po.xsd with the internalorder.xsd, open both files and
answer the following questions:
Hints: To view both XML schema files at the same time, JDeveloper allows you to
rearrange the XSD windows side-by-side (horizontally) or one above the other
(vertically). If needed ask your instructor to demonstrate this capability.
a) Associate the first-level child elements of the PurchaseOrder element in the
po.xsd with their corresponding order elements in the
internalorder.xsd, and identify the differences in XML element names
and types (if any).
b) Expand the items element of the PurchaseOrder parent in the po.xsd, and the
corresponding items element of the order parent in the
internalorder.xsd, and describe the main differences.
c) Expand the OrderItemType complexType in the po.xsd and itemType
complexType in the internalorder.xsd and identify the differences in
XML element names and types.
d) Which element in the po.xsd is assigned the OrderItemType?
4) In JDeveloper, close the files application and remove from the IDE by performing
the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Application Navigator, click the Application Menu icon, and select Close
Application.
b) In the Confirm Close Application dialog box, accept the default Close
application and remove it from IDE option and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The following table has been added for reference to collate the answers for some of the
questions in the current practice:
Step
2c)
2d) i)
Answers
The OrderItem > price element type is xsd:decimal.
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
ID
orderId
payOption, type:payOptionType
payMethod, type:payMethodType
shipChoice, type:shipOptionType
shipMethod, type: shipMethodtype
ccType and ccNumber, both string
creditCard, type:ccInfoType
types
orderTotal
Note: The payOptionType values are the same as the payMethodType values
(as observed by the enumerated values in each schema). The same applies to
the shipChoiceType and the shipMethodType definitions. If a single
company is sharing these XSD definitions one could rearrange XML
elements definitions to share a consistent type definitions.
3b)
The items element in the internalorder.xsd contains the additional
child called inStock.
Note: The inStock element is used to track if all items for a given order are in
stock (value = true) so that an order can be fulfilled. If any item in the order
is not in stock (value = false) then the whole order is place in a waiting
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)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you use the soademo Database Connection to locate the database tables
and view supplied database data for customers, and credit cards. Feel free to explore
additional tables (if you have time).
1) In the JDeveloper window, click View > Database Navigator.
2) In the Database Navigator, click the Expand (+) icon next to the soademo
connection.
Note: This action also opens a SQL Worksheet in a window named soademo, in
which you can enter and execute SQL statements.
3) Examine the CREDITCARDS database table structure and sample data by performing
the following steps:
a) In the Database Navigator, click the Expand (+) icon next to the Tables node
b) Double-click the CREDITCARDS table. This expands the CREDITCARDS table
entry and opens a tab page with a description of the columns.
c) On the CREDITCARDS page, click the Data subtab at the bottom of the window
to view the data in the table.
5) Click the Application Navigator tab, and optionally close the Database Navigator.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The goal of this practice is to create your first simple SOA composite application, which
is the starting point for your course application. The initial POProcessing composite
application assembly model should appear as shown in the following screenshot:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Choices or Values
Application Name: POApplication
Application Template: SOA Application
Click Next.
Project Name: POProcessing
Click Next.
Composite Template: Empty Composite
Click Finish.
Note: Use the following screenshots as a guide for the corresponding steps in the
table above.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
3) The composite.xml file is opened, and select File > Save All to save the changes
to your Application and Project.
4) In the composite.xml window, drag a Web Service component into the Exposed
Services column.
5) To configure the interface for the Web Service interface perform the steps in the
following table:
Step Screen/Page Description
a.
Create Web Service
b.
c.
Type Chooser
d.
e.
f.
g.
h.
Type Chooser
i.
j.
Create WSDL
Create Web Services
Choices or Values
Name: ReceivePO
Next to the WSDL URL field, click the
Generate WSDL from schema(s) icon (
Next to the URL field, click the browse
schema file icon (
icons.
).
Optionally, use the following screenshots as a guide for the steps in the above table:
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f)
g)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
i)
j)
6) In the composite.xml window, verify that the ReceivePO icon appears in the
Exposed Services column. For example:
7) Select File > Save all to save the changes to the project.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Create Mediator Component window, set the name to RoutePO and select
the Define Interface Later template, and click OK.
Note: The Mediator interface is defined by wiring the SOAP service to the
Mediator component. The interfaces are implicit.
c) Create a wire from the ReceivePO exposed service icon to the RoutePO Mediator
icon, by dragging the right-edge arrow icon from the ReceivePO exposed service
to the left-edge arrow on the Mediator component. Use the following image as a
guide:
9) Select File > Save, or click the Save All icon to save the changes to your application.
You now create an external reference for the File Adapter to write the input message
structure to a file in the file system.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
10) Using the Windows Explorer, create a new subfolder called podata in the
D:\labs folder.
11) In the composite.xml window, drag a File Adapter component from the
Component Palette on to the External References column.
12) On the Adapter Configuration Wizard pages, use instructions in the following table to
configure the File Adapter:
Step Screen/Page Description
a.
Welcome
b.
Service Name
c.
Adapter Interface
d.
Operation
Choices or Values
Click Next.
Service Name: WritePOFileService
Click Next.
Select the Define from operation schema
(specified later) option.
Click Next.
Select the Write File option.
Click Next.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Choices or Values
Directory for Outgoing Files:
D:\labs\podata
Note: You can click Browse to locate and
select the specified folder.
File Naming Convention:
order_%SEQ%.xml
Click Next.
Note: If you require help to perform this task, use the following screenshots as a
guide for steps in the table:
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d)
e)
13) On the Adapter Configuration Wizard page, continue to configure the File Adapter
WSDL interface by importing the internalorder.xsd XML schema and
selecting its order element, by performing the following steps:
Step Screen/Page Description
a.
Messages
b.
Type Chooser
c.
d.
e.
f.
Localize Files
g.
Type Chooser
h.
i.
Messages
Finish
Choices or Values
Click Browse for schema file icon.
Click the Import Schema (
) icon.
Click the Browse Resources icon.
In the D:\labs\files\xsd folder select
internalorder.xsd, and click OK.
With the internalorder.xsd file selected, click
OK.
Copy Options: Deselect the Maintain original
directory structure for imported files check box, and
click OK.
Expand the Project Schema Files >
internalorder.xsd entry (if needed), select
order, and click OK.
Click Next.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e)
f)
g)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
h)
i)
14) In the composite.xml file window, verify the File Adapter icon has been added to
External References column.
15) Create a wire from the Mediator component to the File Adapter by dragging the rightedge arrow of the Mediator component to the left-edge arrow on the File Adapter
icon. Use the following image as a guide:
16) Select File > Save All to save the changes to your project, and verify that your
composite application matches the following diagram:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you create a transformation on the routing rule added due to wiring the
RoutePO Mediator component to the WritePOFileService. An XSL transformation is
required to ensure that the PurchaseOrder XML information is correctly copied to the
format of the order XML structure required by the files written to disk by the
WritePOFileService. To quickly create the transformation map required you use an XML
dictionary map file called Order-Dictionary.xml in the XSLT Mapper. To
complete this task perform the following steps:
1) In the POProcessing composite.xml window, to edit the Mediator component
double-click the RoutePO Mediator icon.
Note: Alternatively, right-click the RoutePO Mediator icon and select Edit.
2) In the RoutePO.mplan window, expand the routing rule section for the execute
operation and click the Select an existing mapper file or create a new one (
icon, next to the Transform Using body: <<Transformation Map>> field.
3) On the Request Transformation Map dialog box, select the Create New Mapper File
option, and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e)
Note: At this time, there are no source elements that directly map to the orderPrice,
items > inStock, items > item > itemTotals elements in the XSLT File:
WritePOFileService.wsdl column. Mappings for these elements are done in a
subsequent practice. The for-each construct is automatically inserted for the item
element because it is a repeating element.
6) Click the RoutePO.mplan window, and confirm that the Transform Using field
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you deploy and test the POProcessing composite application project to
the SOA server and use the Enterprise Manager Web application to test the service with a
sample input. To complete this task perform the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2) On the SOA Deployment Configuration Dialog, accept default settings and click OK.
3) Since this is the first time you are deploying an application in your JDeveloper
session, the Authorization Request window is displayed. Enter weblogic
in the Username field, welcome1 in the Password field, and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4) Deployment processing starts. Monitor deployment progress and check for successful
compilation in the SOA Log window, and verify that deployment is successful in
the Deployment Log window, similar to what is shown in the following images:
In this section you use a Web browser to access the Oracle Enterprise Manager 11g
Fusion Middleware Control and initiate a test of the deployed POProcessing application.
5) Log in to Oracle Enterprise Manager 11g Fusion Middleware Control application and
open a Web browser by performing the following steps:
a) In the Web browser window, enter the URL http://localhost:7001/em.
b) On the Oracle Enterprise Manager 11g Fusion Middleware Control login page,
enter the User Name weblogic, and Password welcome1, and click Login.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) On the Farm navigation pane, expand the SOA > soa-infra nodes in the tree and
click the POProcessing [1.0] link.
7) On the Test Web Service page, scroll down to the Input Arguments section to the
Request tab, select XML View and replace the initial XML contents with the XML
data in the file D:\labs\files\xml_in\po-medium-ipod.xml. If you
require help to replace the initial XML text, use the following steps (or similar):
a) With JDeveloper, select File > Open and browse to the
D:\labs\files\xml_in folder, select po-medium-ipod.xml and select
Open.
b) In the JDeveloper po-medium-ipod.xml window, press Ctrl +A to select all
the text, and press Ctrl + C to copy the selection to the clipboard.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c) On the POProcessing [1.0] Test Web Service page, place the cursor in the XML
text area of the Input Arguments, and press Ctrl + A to select all the text and press
Ctrl + V to paste it into the XML View replacing the initially supplied XML text.
Use the following screenshot as a guide:
d) On the POProcessing [1.0] Test Web Service page, Click Test Web Service.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
IMPORTANT NOTE: When you click Test Web Service, you may the following
saying, Input arguments validation failed and The test was not run as shown in
the following image:
If you see the above error dialog box, then perform the following steps to correct and
resubmit the data:
i) On the Input arguments validation failed dialog box, click OK.
ii) On the Request tab, in Input Arguments section modify the contents of XML
View field based on the following options:
(1) If there is extra space or lines at the end of all the XML data, delete
those spaces and lines ensuring the XML data is unaffected, and click
Test Web Service, or
(2) If there is no extra space or lines at the end of all the XML data, put
the cursor or mouse pointer after the last character on the last line of
the XML data, press Enter, and click Test Web Service
Note: Throughout the rest of the course you may have to repeat this process as
required when submitting XML data to initiate tests for each composite
application.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
9) On the Flow Trace page, verify that the ReceivePO, RoutePO, and
WritePOFileService components have a Completed state indicating the application
executed successfully.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Using JDeveloper open the order_1.xml file to view its contents and verify
that the XML file contains similar (if not the same) data in the following image:
c) In the JDeveloper window, close the order_1.xml and the po-mediumipod.xml windows.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
by using Enterprise Manager.
The above tasks are represented in the following image:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you modify the POProcessing composite application and alter the File
Adapter to use a logical name instead of an explicit directory for orders written to the file
system. You then create a binding property that is to set the directory to the D:\labs
directory, and deploy the application using JDeveloper and test the order is written to a
file in the labs directory.
Screen/Page Description
composite.xml
Choices or Values
Double-click the WritePOFileService
external reference icon.
b.
Click Next.
c.
d.
e.
f.
Click Next.
Click Next.
Click Next.
Select the Logical Name option
Directory for outgoing files (logical name):
orderfiles
Click Next.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step
Screen/Page Description
Choices or Values
g.
Click Next.
h.
Click Finish.
3) To set the path value for the orderfiles logical name perform the following steps:
a) In the composite.xml window, click the WritePOFileService external
reference icon ensure that the File Adapter reference is selected.
b) In the Property Inspector for the Reference WritePOFileService (in the lower
right pane in the JDeveloper window), observe that JDeveloper has added a File
Adapter reference property called orderfiles for the logical name.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4) Select File > Save All to save the changes to the application.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the SOA Deployment Configuration Dialog, select the Overwrite any existing
composites with the same revision ID option, and click OK.
c) In the Log window, observe the log messages to ensure that deployment is
successful.
1
2
credit
two_day
Initial
AMEX
1111-2222-3333-4444
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) While still in the Tree View mode, expand the items field, and in the item field (as
shown above) enter the value 1 in the OrderItemTypeArray Size, and click the
document icon.
c) Expand the OrderItemTypeArray item and the OrderItemType item and enter the
following field values, and then click Test Web Service.
productId:
productName:
price:
quantity:
SKU102
Test Product
100
1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
10) On the POProcessing [1.0] Response tab page, click the Launch Message Flow
Trace link.
11) On the Flow Trace page, verify that the POProcessing composite application instance
completed all processing successfully.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) Either using Windows Explorer or JDeveloper, navigate to the D:\labs folder and
confirm that a file called order_1.xml has been created in the directory, and open
the file to confirm that contains the values entered in the Enterprise Manager Web
service test page form fields.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you create configuration plan for the POProcessing composite application
to replace the destination directory for the orderfiles logical name reference
property. After you verify the configuration plan, you redeploy the composite application
by using the Enterprise Manager Web interface applying the configuration plan, verify
and test the changes.
2) In the Composite Configuration Plan Generator dialog box, accept the default plan
file name, and click OK.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
<replace>D:\labs\podata</replace>
4) Select File > Save All to save the changes to the project files.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
6) In the Composite Configuration Plan Validator dialog box, accept the default
selection and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you redeploy the POProcessing composite application using the
configuration plan file generated and validated in the previous practice. You also test the
deployed application to confirm that the configuration plan changes are applied.
To complete these tasks perform the following steps:
1) Return to your Web browser with the Enterprise Manager page, and redeploy
POProcessing composite application using the deployment plan file modified in the
previous steps. To complete this task perform instructions in the following table
Step Screen/Page
Description
a.
Oracle Enterprise
Manager SOA >
soa-infra Farm tree
b.
POProcessing
[1.0] Redeploy
SOA Composite
c.
File Upload
d.
e.
f.
g.
POProcessing
[1.0] Redeploy
SOA Composite
File Upload
POProcessing
[1.0] Redeploy
SOA Composite
POProcessing
[1.0] Redeploy
SOA Composite
Choices or Values
Right-click the POProcessing [1.0] link and select SOA
Deployment > Redeploy.
In the Archive or Exploded Directory section, select
Archive is on the machine where this Web browser is
running option, and click Browse.
Navigate to the D:\labs\mywork\POApplication
\POProcessing\deploy folder and select the
sca_POProcessing_rev1.0.jar file, and click Open.
Under the Configuration Plan section, select the
Configuration plan is on the machine where this Web
browser is running option, and click Browse.
Navigate to the
D:\labs\mywork\POApplication\POProcessing
folder and select the POProcessing_cfgplan.xml file,
and click Open.
Scroll back to the top (if needed) and click Next.
Click Redeploy.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e)
f)
g)
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.
3) In the Definition window, locate the XML <property> element with the
name="orderfiles" attribute, and verify that the value is D:\labs\podata,
as expected due to redeployment with the configuration plan. Then click OK to close
the window.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: We have not modified the POProcessing composite application source code and
have not even recreated the SOA Archive file during the redeployment process.
4) Using Oracle Enterprise Manager to test that the POProcessing composite application
now writes order files in the D:\labs\podata folder, as defined by the
configuration plan, use instructions in the following table:
Step Screen/Page Description
a.
POProcessing [1.0]
b.
POProcessing [1.0] Test Web
Service
Choices or Values
Click Test
In the Input Arguments Request tab section,
select the XML View option, and replace the
supplied XML data with the contents of the
D:\labs\files\xml_in\po-smallipod.xml file (using copy and paste
techniques).
Click Test Web Service
Note: If you require help to perform this task, use these screenshots as a guide for
instructions in the preceding table:
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
5) After verifying that the new POProcessing composite application instance completed
successfully in the Flow Trace page, use Windows Explorer to verify that the
order_1.xml file has been created with supplied data in the D:\labs\podata
folder.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
The following image represents the composite application design for your
CreditCardValidation project:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you create a new SOA Project, called CreditCardValidation, in the
POApplication workspace, which contains a Mediator component called
ValidateCreditCard. To complete this task perform the following steps:
1) In the JDeveloper Application Navigator window, with the POApplication visible in
the Application menu, click the Application Menu icon and select New Project.
2) In the New Gallery window, select the SOA Project in the Items list of the Project
category, and click OK.
3) In the Create SOA Project Step 1 of 2 Project Name window, enter the Project
Name: CreditCardValidation, and click Next.
4) In the Create SOA Project Step 2 of 2 Configure SOA Settings window, select the
Composite With Mediator for the Composite Template option, and click Finish.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Screen/Page Description
Create WSDL > Request
Type Chooser
Import Schema File
SOA Resource Browser
Choices or Values
Click the Browse icon next to the URL field.
Click the Import Schema icon.
Click the Browse icon.
Using the File System option, locate and
select the creditcheck.xsd in the
D:\labs\files\xsd folder, and click
OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Localize Files
g.
Type Chooser
h.
Choices or Values
With the creditcheck.xsd selected,
click OK.
Deselect the Maintain original directory
structure for imported files option, and click
OK.
Expand the Project Schema Files >
creditcheck.xsd nodes (if needed) and
select the CreditCheckRequest element, and
click OK.
Change the fields as follows:
Operation Name: validateCC
Port Type Name: validateCC_ptt
Click the Reply tab.
Note: Do not click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
g)
f)
h)
7) On the Create WSDL > Reply tab page, to define the Reply message structure for the
Mediator component WSDL interface, use instructions in the following table as a
guide:
Step Screen/Page Description
a.
Create WSDL > Reply
b.
Type Chooser
c.
Create WSDL
Choices or Values
Click the Browse icon next to the URL field.
Expand the Project Schema Files >
creditcheck.xsd nodes (if needed) and
select the CreditCheckResponse element, and
click OK.
Click the Fault tab.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
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
a.
Create WSDL > Fault
b.
Type Chooser
c.
Create WSDL
Choices or Values
Click the Browse icon next to the URL field.
Expand the Project Schema Files >
creditcheck.xsd nodes (if needed) and
select the CreditCheckFault element, and click
OK.
Click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
9) In the Create Mediator window, to create the Mediator component and its associated
exposed service, verify the settings match the following screenshot with the Create
Composite Service with SOAP Bindings check box selected, and click OK.
11) In the composite.xml window, verify you initial composite assembly model
resembles the following image:
12) Select File > Save All to save your changes to the composite application project.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2) To configure the Database Adapter with the Adapter Configuration Wizard the
following instructions:
a) Adapter Configuration Wizard Welcome, click Next.
Step Screen/Page Description
b.
Adapter Configuration Wizard
Service Name
c.
Adapter Configuration Wizard
Service Connection
d.
Select IDE Database
Connection
e.
Adapter Configuration Wizard
Service Connection
f.
Adapter Configuration Wizard
Operation Type
g.
h.
i.
j.
k.
l.
Choices or Values
Service Name: CreditCardDBService
Click Next.
Click the Browse (flashlight) icon next to
the connection field.
Select the soademo entry, and click Copy
Connection.
Observe the JNDI Name has the value
eis/DB/soademo, and click Next.
Select the Perform an operation on a Table
option, and ensure the Select check box is
selected, and deselect other operations.
Click Next.
Click Import Tables.
Click Query.
Copy the CREDITCARDS table from the
Available list to the Selected list, click OK.
With the CREDITCARDS table listed, click
Next.
Click Next.
Select the creditLimit and status
attribute options, deselect remaining options.
Note: The cardNumber (key attribute)
cannot be deselected.
Click Next.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
h)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
j)
k)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
l)
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
a.
Adapter Configuration Wizard
Define Selection Criteria
b.
Parameter Name
c.
Adapter Configuration Wizard
Define Selection Criteria
d.
Expression Builder
e.
Expression Builder
Choices or Values
Next to the Parameters section, click Add.
Enter ccNum and click OK.
Next to the SQL field, click Edit.
Click Add.
Form the condition:
cardNumber EQUAL ccNum, where:
First Argument Query Key: cardNumber
f.
g.
h.
Choices or Values
Operator: EQUAL
Second Argument: select the Parameter
option, and select ccNum
Click OK.
Verify your SQL statement is correct, and
click Next.
Click Next.
Click Finish.
a)
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f)
g)
h)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Request Transformation Map window, click the Create New Mapper File
option, accept the default file name supplied, and click OK.
b) In the XSLT Mapper window, map the CCNumber element in the Source column
to the ccNum element in the target column, as shown in the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Reply Transformation Map window, select the Create New Mapper File
option, accept the default file name supplied, and click OK.
b) In the XSLT Mapper window, expand the source tree and map the status element
in the Source column to the status element in the target column.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
9) Verify the composite application assembly model resembles the following image:
10) In the JDeveloper window, close the XSLT Mapper and the
ValidateCreditCard.mplan windows.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you deploy and test the CreditCardValidation composite application. To
complete this task perform the following steps:
1) In the JDeveloper Application Navigator, right-click the CreditCardValidation project
entry and select Deploy > CreditCardValidation > to > soaserver.
a) In the SOA Deployment Configuration Dialog window, click OK.
Note: If you get the Authorization Request window, enter the user name
weblogic and password welcome1.
b) In the Deployment Log window verify that deployment is successful.
2) In a Web browser window, access the URL http://localhost:7001/em (or return to the
page that already has Enterprise Manager SOA page displayed). To perform the first
test, login to the Enterprise Manager application (if required) as weblogic with
password welcome1.
a) On the Farm navigator pane, expand SOA > soa-infra (in needed refresh the page)
so that you can see the CreditCardValidation [1.0] entry. Click the
CreditCardValidation [1.0] link.
b) On the CreditCardValidation [1.0] home page, click Test
c) On the Test Web Service page, scroll down the page to the Input Arguments
section Request tab and enter the following values:
CCNumber: 1234-1234-1234-1234
amount: 1000
Click Test Web Service.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) Wait for the Response tab to be displayed and verify that the status value returned
is VALID, as shown in the following image:
3) To perform a second test, to enter another request click the Request tab.
a) On the Request tab page, modify the CCNumber value to be 4321-43214321-4321, leave the amount at 1000, and click Test Web Service.
b) On the Response tab page, verify that the status string value returned is
INVALID, as shown in the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The goal of this practice is work with Mediator components in the POProcessing
composite application. The Mediator routing rules and XSL transformations are used to
calculate the order item and order totals. The following image depicts the new assembly
model and changes to the POProcessing composite application:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you restructure the POProcessing composite application assembly model
by adding a new Mediator component between the RoutePO Mediator component and the
WritePOFileService. This requires deleting the existing routing rule (wire) between the
RoutePO and WritePOFileService, adding a new Mediator component, and creating the
wires needed to complete the application assembly model.
To complete this task perform the following steps:
1) In the JDeveloper Application Navigator, open the composite.xml file in the
POProcessing project by double-clicking the composite.xml file name.
Note: If required, expand the POProcessing project and its SOA Content folder to
locate the composite.xml file.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: Deleting a routing rule from a Mediator component deletes the associated
wire from the composite.xml file. However, deleting the wire from the
composite.xml removes the target service from the associated Mediator
routing rule, that is, a routing rule is not deleted when its associated wire is
deleted.
d) In the Confirm Delete dialog box, click Yes.
e) In the JDeveloper window, click the composite.xml tab and verify that the
wire between the RoutePO and WritePOFileService has been removed. Use the
following image as a guide:
Create Mediator
Choices or Values
Drag a Mediator component from the component
palette into the Components column.
Name: EnrichPO
Template: One-Way Interface
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
Type Chooser
d.
Create Mediator
Choices or Values
Deselect the Create Composite Service with
SOAP Bindings check box.
Input: Click the Browse Input Elements icon ( ).
Expand Project Schema Files >
internalorder.xsd, select the order element,
and click OK.
Click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
d)
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
) of the
5) In the JDeveloper window, select File > Save All to save the changes to all files in the
project.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you modify an existing XSL Transformation to calculate the item totals
for order item when the data is being routed to the second Mediator component. In
addition, you create a new XSL transformation for the new Mediator component. The
new XSL Transformation copies the internal order items and calculates the order total
from the item totals before the transformed data is sent to other services, such as the
WritePOFileService.
To complete these tasks perform the following steps:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Choices or Values
Expand the POProcessing > SOA
Content > xsl folder, and double-click the
PurchaseOrder_To_order.xsl
file.
PurchaseOrder_To_order.xsl Expand the items and item nodes in both
the source and target columns, and drag a
multiply component, from the
Mathematical Functions in the
Component Palette, to the middle column
of the XSLT Mapper.
PurchaseOrder_To_order.xsl Drag the price from the source column
onto the left-side handle of the multiply
function in the middle column of the
XLST Mapper.
b.
c.
d.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
4)
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
b)
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Create a New XSL File for the EnrichPO Mediator Routing Rule
The EnrichPO Mediator component has the same internal order element structure that
is routed to target services (such as the WritePOFileService). However, the incoming data
provides an orderTotal initialized to 0.0 and all the itemTotal elements have been
calculated. You create a new XSL file to calculate the orderTotal from the sum of all the
itemTotal elements.
1) To create a new XSL file for the routing rule to the WritePOFileService that
calculates the sum of all itemTotal elements to the orderTotal, perform the following
steps:
a) In the composite.xml window, double-click the EnrichPO Mediator
component to open the Mediator Editor.
b) In the EnrichPO.mplan window, under the Routing Rules section in the Static
Routing for the execute operation, click the Select an existing mapper file or
create a new one. Icon ( ).
c) In the Request Transformation Map window, select the Create New Mapper File
option, accept the default XSL file name order_To_order.xsl, and click
OK.
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.
Oracle SOA Suite 11g: Build Composite Applications 104
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c) Drag a line from the itemTotal (expanding the items > item element, if required)
from the source on to the left-side handle of the sum function in the middle
column.
d) Drag a line from the right-side handle of the sum function to the orderTotal
element in the target column.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you deploy and test the modified POProcessing composite application.
To complete this task perform the following steps:
1) To deploy the modified POProcessing project, perform the following steps:
a) In the JDeveloper Application Navigator window, right-click the POProcessing
project and select Deploy > POProcessing > to > soaserver.
b) In the SOA Deployment Configuration dialog box, accept all the default settings
and select the Overwrite any existing composites with the same revision ID
check box. Click OK.
Note: If the Authorization Request dialog box is displayed, enter the user name
weblogic and password welcome1, and click OK.
c) On the Deployment Log window, confirm that deployment is successful.
2) In a Web browser window, if needed enter the URL
http://localhost:7001/em and login with the user name weblogic and
password welcome1.
3) Test the updated POProcessing composite application, which writes order files in the
D:\labs\podata folder, by using Oracle Enterprise Manager with instructions in
the following table:
Step Screen/Page Description
a.
Enterprise Manager home
b.
c.
POProcessing [1.0]
POProcessing [1.0] Test Web
Service
Choices or Values
Expand the SOA folder in the Farm navigation
tree, and click the POProcessing [1.0] link.
Click Test.
In the Input Arguments Request tab section,
select the XML View option, and replace the
supplied XML data with the contents of the
D:\labs\files\xml_in\po-mediumipod.xml file (using copy and paste
techniques).
Note: Ensure you delete any trailing spaces
from the XML payload before clicking Test
Web Service.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
b)
4) After verifying that the new POProcessing composite application instance completed
successfully in the Flow Trace page.
5) In Windows Explorer, verify that the order_2.xml file has been created with
supplied data in the D:\labs\podata folder.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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 orderprocessing tasks. The following image shows the assembly model changes:
After modifying the assembly model you edit the following two BPEL process
components and create their structure with their initial Scope, Assign, and Transform
activities:
1. The ApproveCCOrder BPEL process that validates the credit card and is later
modified to include human workflow to manually approve orders if their total
exceeds 3000.
2. The Fulfillment BPEL process that performs processing tasks to fulfill approved
orders. Fulfillment processing includes checking if stock (inventory) for the order
is available from an internal and online store, selecting the store to supply the
products for an order, and sending the order to a shipping company.
The tasks required to change the assembly model include:
Adding the two BPEL components
Adding the wires between components, and modifying the EnrichPO Mediator
component with routing rules that use filters to route paypal orders to the
WritePOFileService and Fulfillment BPEL process, and credit orders to the
ApproveCCOrder BPEL process.
Adding a wire from the ApproveCCOrder BPEL process to the Fulfillment BPEL
process to ensure credit card orders that are approved are fulfilled.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you modify the POProcessing assembly model, by adding two BPEL
Process components and implementing the wires for the required interactions.
Add and wire the ApproveCCOrder BPEL component into the POProcessing assembly
model as shown in the following image:
3) In the Create BPEL Process window, configure the BPEL Process by using
instructions in the following table and associated screenshots:
Step Screen/Page
Description
a.
Create BPEL
Process
Choices or Values
Name: ApproveCCOrder
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
( ).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step Screen/Page
Description
b.
Type Chooser
c.
Create BPEL
Process
Type Chooser
d.
e.
Create BPEL
Process
Choices or Values
Expand the Project Schema Files >
internalorder.xsd, select order and click OK.
Next to the Output field, click the Browse Output
Elements icon ( ).
Expand the Project Schema Files >
internalorder.xsd, select order and click OK.
Verify that the Template is set to Asynchronous BPEL
Process, that the Input and Output elements have
{http://www.example.org/ns/intorder}order
as their value, and that the Expose as a SOAP service
option is not selected, and click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e)
5) Verify that your composite.xml assembly model resembles the following image:
6) Click File > Save All to save changes to all files in the POProcessing project.
In this section, you add the Fulfillment BPEL Process component to the composite
application assembly model, and create wires from the EnrichPO Mediator component
and the ApproveCCOrders BPEL process to the Fulfillment BPEL process. Use the
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
a.
Create BPEL Process
b.
Type Chooser
c.
Choices or Values
Name: Fulfillment
Deselect the Expose as a SOAP service
check box
Input: Click the Browse Input Elements icon
( ).
Click the Import Schema File icon ( ).
Click the Browse Resources icon ( ).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f.
Localize Files
g.
Type Chooser
h.
i.
Type Chooser
j.
Choices or Values
Navigate to the D:\labs\files\xsd
folder, select fulfillment.xsd, and click
OK.
URL:
file:/D:/labs/files/xsd/fulfil
lment.xsd
With Copy to Project check box selected.
Click OK
Copy Options: Ensure you deselect both the
Maintain original directory structure for
imported files and the Rename duplicate
files check boxes, as follows:
Click OK.
Expand the Project Schema Files >
fulfillment.xsd, select
FulfillmentRequest and click OK.
Output: Click the Browse Output Elements
icon ( )
Expand the Project Schema Files >
fulfillment.xsd, select
FulfillmentResponse and click OK.
Verify the following settings:
Template: Asynchronous BPEL Process
Input:
{http://www.example.org/ns/ful
fillment}FulFillmentRequest
Output:
{http://www.example.org/ns/ful
fillment}FulFillmentResponse
Ensure the Expose as a SOAP service check
box is not selected.
Click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
9) In the composite.xml window, verify that your assembly model includes the
stand-alone Fulfillment BPEL process. Use the following screenshot as a guide:
10) To create a wire from the EnrichPO Mediator component to the Fulfillment BPEL
component, click and drag the Drag to add a new Reference icon ( ) from the
right edge of the EnrichPO Mediator component to the left edge service interface icon
( ) of the Fulfillment BPEL component.
11) To create a wire from the ApproveCCOrder BPEL component to the Fulfillment
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) Verify that your composite.xml assembly model resembles the following image:
13) Click File > Save All to save changes to all files in the POProcessing project.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you modify the EnrichPO Mediator component and modify the following
routing rules with the target service:
WritePOFileService::Write: You add a filter to check if the input <payMethod>
has the string paypal. Only paypal orders are sent to the WritePOFileService.
The XSL Transformation is already configured for this rule.
ApproveCCOrder/approveccorder_client::process: You add a filter to check if the
input <payMethod> has the string credit. Only credit card orders are sent to the
ApproveCCOrder BPEL process. In this case, you use the same XSL
Transformation file configured for the WritePOFileService routing rule.
Fulfillment/fulfillment_client::process: You add a filter to check if the input
<payMethod> has the string paypal. Paypal orders must still be routed to the
Fulfillment BPEL process to ship products and complete the order cycle. In this
case, you need to create a new XSL Transformation to calculate the order total,
and cannot reuse the order_To_order.xsl file, because the target XSD has
different parent element to the order element.
To complete these tasks perform the following steps:
1) In the POProcessing composite.xml window, to edit the routing rule definitions
of the EnrichPO Mediator double-click the EnrichPO Mediator component icon.
Expression Builder
Choices or Values
In the routing rule to WritePOFileService, click the
Invoke Expression Builder icon ( ).
In the Variables section, expand the in > request > order
tree, select payMethod and click Insert Into Expression.
In the Expression field append: = 'paypal' to the
XPath expression for payMethod to form an expression
similar to:
$in.request/inp1:order/inp1:payMethod
= 'paypal'
Click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a)
b)
3) On the JDeveloper menu, click File > Save All, or click the Save All icon (
JDeveloper toolbar.
)on the
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
).
b) In the Request Transformation Map window, use the Use Existing Mapper File
option (the default), and click the Browse Mappings icon ( ).
c) In the SOA Resource Browser window, select the order_To_order.xsl file
from the project XSL folder, and click OK.
d) In the Request Transformation Map window, with the Use Existing Mapper File
field set to xsl/order_To_order.xsl, click OK.
Note: In this case, we are using an existing XSL file because it meets with the
requirements for this routing rule source and target element structures.
6) On the JDeveloper menu click File > Save All, or click the Save All icon (
JDeveloper toolbar.
) on the
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 (
).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Expression Builder window, in the Variables section, expand the in >
request > order tree, select payMethod and click Insert Into Expression.
).
b) In the Request Transformation Map window, select the Create New Mapper File
option, and accept the default Mapper File Name
order_To_FulFillmentRequest.xsl and click OK.
c) In the order_To_FulFillmentRequest.xsl window, map all elements
by dragging the order element from the sources tree on to the
FulfillmentRequest element in the target tree.
d) In the Auto Map window, accept all the default settings and click OK.
e) In the order_To_FulFillmentRequest.xsl window, delete the map line
connecting the orderTotal elements.
f) In the order_To_FulFillmentRequest.xsl window, to calculate the
orderTotal correctly, perform the following mapping actions:
i) Drag a Sum function from the Mathematical Functions group in the
Component Palette into the middle column of the window.
ii) Expand the source tree until you see the itemTotal, in the items > item child
nodes, and drag the itemTotal to the left-side handle on the Sum function in
the middle column.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
iii) Drag the right-side handle of the Sum function in the middle column to the
orderTotal in the target column.
Use the following image as guide to your final mapping results:
g) Select File > Save All to save the transformation map file and
EnrichPO.mplan file changes.
9) Close the EnrichPO.mplan and order_To_FulFillmentRequest.xsl
windows.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you edit the ApproveCCOrder BPEL Process component and structure
process flow with Scope activities that:
Reflect tasks in the business process flow
Simplify management of the process complexity
The following image represents the BPEL process flow diagram you create in this
practice:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
the Fulfillment service and a Transform activity to prepare the input data that is
required by the Fulfillment BPEL process.
Note: A hybrid development and design approach is being followed for creating the
course application. With a hybrid approach you do some top-down process assembly and
structural design with the visual designers, and fill in the implementation details later.
However, you continue to develop and deploy other smaller composite applications, such
as the CreditCardValidation composite application, and Web services that are required as
external service to complete the POProcessing application. In addition, because the next
lesson teaches how to invoke other services from a BPEL process, you do not implement
activities to invoke external services from BPEL in this practice. Invoking other services
from BPEL is covered in the lesson titled Orchestrating Services with BPEL and its
associated practices.
Additional Note: You can use either of the following ways to rename BPEL activities:
Double-click the activity name, enter the new name, and press Enter.
Double-click the activity icon, replace the name in the General tab, and click OK.
For brevity, subsequent instructions just ask you to rename the activity and do not spell
out the specific steps to rename an activity.
To create the initial ApproveCCOrder BPEL process flow, perform the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Drag an Assign activity from the BPEL Activities on the Component Palette into
the BPEL process flow.
c) Drag a Scope activity from the Component Palette into the flow after the assign
activity.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e) Drag another Scope activity from the Component Palette into the flow after the
Scope_validatecc activity.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3) Select File > Save to save the changes to the ApproveCCOrder BPEL Process.
In this section, you edit the Assign activity and create a copy operation to store a working
copy of the order from the inputVariable in the outputVariable.
4) In the ApproveCCOrder.bpel window, to edit the activity and add copy
operations double-click the Assign_orderinfo activity.
Note: Alternatively, you can right-click the Assign_orderinfo activity and select Edit.
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
a.
Assign > Copy Operation
Choices or Values
Click the Add icon (
Operation.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Choices or Values
In the From section, using Variable as the Type,
expand the Process > Variables > inputVariable >
payload, and select order.
In the To section, using Variable as the Type,
expand the Process > Variables > outputVariable
> payload, and select order.
Click OK.
c.
Assign
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
Note: When you select an element in a variable tree structure you are creating an
XPath expression for that element that is added to the BPEL source code in the
associated activity XML element attribute values. The XPath expression helps the
BPEL Engine extract the XML fragment or value and copy it to the target
element.
c)
6) Select File > Save to save the changes to the ApproveCCOrder BPEL Process.
In this section, you expand the scope and add an Empty activity into the scope. The
Empty activity is used as a placeholder for other process activities that are added in the
Oracle SOA Suite 11g: Build Composite Applications 132
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
practices for the lesson titled Orchestrating Services with BPEL. The Empty activity is
required in this practice so that we can successfully compile and deploy the composite
application that contains the BPEL process.
7) In the ApproveCCOrder.bpel window, to expand Scope_validatecc activity,
click its Expand icon ( ).
Note: You must first expand a scope to add activities into its structure.
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.
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 ( ).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
10) Select File > Save to save the changes to the ApproveCCOrder BPEL Process.
In this section, you expand the Scope_fullfilment activity and add two local variables
called fulfillmentRequest and fulfillmentResponse, respectively. The two variables are
used by activities that are added to interact with the Fulfillment BPEL process in the
practices for the lesson titled Orchestrating Services with BPEL. After creating the
variables you create a Transform activity in the scope to populate the fulfillmentRequest
variable with the request data.
11) In the ApproveCCOrder.bpel window, expand the Scope_fulfillment activity.
12) In the expanded Scope_fulfillment activity, on the left-hand edge click the Variables
icon ( ). The Variables window is displayed.
13) In the Variables window, create the fulfillmentRequest variable and set its type to the
FulfillmentRequestMessage type defined in the project
fulfillment.wsdl file. Use instructions in the following table and associated
screenshots as a guide:
Step Screen/Page Description
a.
Variables
b.
Create Variable
c.
Type Chooser
d.
Create Variable
Choices or Values
Click the Create icon ( ).
Name: fulfillmentRequest
Type: Select the Message Type option and click the
Browse Message Types icon ( ).
Expand the Message Types > Project WSDL Files >
Fulfillment.wsdl > Message Types folder,
select the FulfillmentRequestMessage, and
click OK.
Confirm the following field settings:
Name: fulfillmentRequest
Type: Select the Message Type option
Message Type: (without the namespace)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Choices or Values
FulfillmentRequestMessage.
Click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d)
14) In the Variables window, confirm that the fulfillmentRequest variable has been added
to the list of variables.
Note: Do not close the Variables window, as you need to create a second variable in
the same window.
15) In the Variables window, create the fulfillmentResponse variable and set its type to
the FulfillmenResponseMessage type defined in the project fulfillment.wsdl
file. Use instructions in the following table as guide (no screenshots are provided):
Step Screen/Page Description
a.
Variables
b.
Create Variable
c.
Type Chooser
d.
Create Variable
Choices or Values
Click the Create icon ( ).
Name: fulfillmentResponse
Type: Select the Message Type option and click the
Browse Message Types icon ( ).
Expand the Message Types > Project WSDL Files >
Fulfillment.wsdl > Message Types folders,
select the FulfillmentResponseMessage,
and click OK.
Confirm the following field settings:
Name: fulfillmentResponse
Type: Select the Message Type option
Message Type: (without the namespace)
FulfillmentResponseMessage.
Click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
16) In the Variables window, confirm that your have two local variables named
fulfillmentRequest and fulfillmentResponse, and click OK to close the Variables
window.
In this section you create a Transform activity to copy the contents of the outputVariable
into the fulfillmentRequest local variable. Therefore the Transform activity must be
added inside the scope to access the fulfillmentRequest variable.
Note: The children elements of each variable are the same; therefore, the transformation
map is quickly created by mapping the parent elements and using the Automap tool to
complete the XSL mapping required.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
19) Configure the transformation source variable as the outputVariable payload, and the
target variable as the fulfillmentRequest payload and create a new transformation
map file called Transformation_to_fulfillment. Use instructions in the following table
and associated screenshots as a guide:
Step Screen/Page Description
a.
Transform > Transformation
b.
Source Variable
c.
Choices or Values
Next to the Source section, click the Create icon
( ).
Source Variable: Select outputVariable
Source Part: payload is already selected
Click OK.
Target Variable: fulfillmentRequest
(should already be selected. If not select it)
Target Type: payload (should also be selected)
Mapper File:
xsl/Transformation_to_fulfillment
Click the Create Mapper File icon ( ).
Note: The XSL file is created and opened in the
XSLT Mapper Editor window.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) On the JDeveloper window menu, select File > Save All to save changes to the
BPEL and XSL file.
e) Close the Transformation_to_fulfillment.xsl window.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you design the high-level business Fulfillment BPEL process flow using
Scope activities. The implementations of activities for each Scope are completed in
subsequent practices of this course. One of the objectives is to learn how to construct a
BPEL Process skeleton or framework which models a process flow and to add the
implementation details later, after dependent services have been constructed. The
following image illustrates the initial structure of the Fulfillment BPEL Process
component:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The shiporder Scope, for preparing and sending the order shipping request.
Initially this scope executes an Assign activity to set the output variable with
shipping status information. In the practices for the lesson titled Implementing
Human Task Services, you modify this scope to contain activities to send the
order shipping request to one of several shipping companies through JMS
Adapters, return the shipping status, and implement email notification.
To create the initial Fullfillment BPEL Process flow, perform the following steps:
In this section you create and name three Scope activities to structure the BPEL process.
3) In the Fulfillment.bpel window, in the BPEL process diagram between the
receiveInput and callbackClient activities create three named Scope activities called
(in the order listed here): Scope_insertorder, Scope_checkstock, and
Scope_shiporder. Use the following image as a guide:
Note: If you require help to perform this task, in the Fulfillment.bpel window
use the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Drag a Scope activity from the Component Palette and drop it between the
receiveInput and callbackClient activities. Rename the scope to
Scope_insertorder.
b) Drag a Scope activity from the Component Palette and drop it after the
Scope_insertorder activity. Rename the new scope to Scope_checkstock.
c) Drag a Scope activity from the Component Palette and drop it after the
Scope_checkstock activity. Rename the new scope to Scope_shiporder.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
6) Expand the Scope_checkstock activity, and using the following screenshot as a guide
drag an Empty activity from the Component Palette into the scope.
7) Collapse each of the Scope activities and save the changes to your project.
In this case, you initialize the response data in the outputVariable with hard-coded string
that are later replaced with dynamic results. This section enables you to learn how to
create two copy operations in the same Assign activity.
8) In the Fulfillment.bpel window, expand the Scope_shiporder, drag an Assign
activity into the scope, and rename the Assign activity to Assign_shipstatus. Use the
following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Copy the string expression 'none' to the outputVariable > payload >
FulfillmentResponse > shipStatus element. Use the following image as a guide:
Note: If you require help to create the copy operation, perform the following
steps:
i) On the Assign > Copy Operations tabbed page, click the Add icon (
select Copy Operation.
) and
ii) In the Create Copy Operation window, in the From section select
Expression as the Type, and in Expression enter: 'none' (including the
single quotes).
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Copy the string expression 'none' to the outputVariable > payload >
FulfillmentResponse > carrier element.
Note: If you require help to create the copy operation, perform the following
steps:
i) On the Assign > Copy Operations tabbed page, click the Add icon (
select Copy Operation.
) and
ii) In the Create Copy Operation window, in the From section select
Expression as the Type, and in Expression enter: 'none' (including the
single quotes).
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
10) On the Assign > Copy Operations tabbed page, verify that the operations are
configured and click OK.
11) Collapse the Scope_shiporder activity, and close the Fulfillment.bpel window,
and save the changes to the POProcessing project.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you deploy the modified POProcessing composite application project,
and perform the following two tests:
Test an order that uses the paypal payment method. This test is designed to check
that paypal orders are sent to the Fullfilment and WritePOFileService and not
processed by the ApproveCCOrder BPEL component.
Test an order that uses the credit payment method, which is designed to check that
credit card orders flow through the ApproveCCOrder and Fulfillment BPEL
Process components and not the WritePOFileService.
In addition, you examine the results of executing Assign and Transform activities by
using Oracle Enterprise Manager to view BPEL component details in the Audit Trail and
Flow tabs of the Flow Trace page.
To complete the testing tasks, perform the following steps:
1) Using JDeveloper, deploy the POProcessing project to the soaserver connection.
When the SOA Deployment Configuration Dialog window is displayed select the
Overwrite any existing composites with the same revision ID. check box.
Note: Enter the login weblogic and welcome1 credentials in an Authorization
Request window, if it is displayed. Monitor the Messages Log and Deployment Log windows to ensure the composite application is successfully deployed. If not,
correct the errors and repeat this step.
2) Open a Web browser window, and enter the Oracle Enterprise Manager URL
http://localhost:7001/em, and if necessary login with Username:
weblogic with Password: welcome1.
3) On the Oracle Enterprise Manager home page, locate and click the deployed
POProcessing [1.0] composite application link (located under the SOA tree in the
Farm navigation pane).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4) On the POProcessing [1.0] page, initiate the first test with the
D:\labs\files\xml_in\po-small-guitar.xml file copied into the
Request > XML View text area and replace the <payOption> element value with
paypal. Use the image as a guide:
Note: If you require help to perform this task, use the following substeps:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5) On the Response tab, click the Launch Message Flow Trace link.
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:
7) On the Flow Trace page, to examine the Fulfillment BPEL Process in the Audit Trail
tabbed page click the Fulfillment link in the Instance column of the Trace tree and
answer the following questions:
a) What is the value of the <orderTotal> element in the inputVariable?
b) Describe the steps to find the orderTotal in the inputVariable.
c) On the Flow tabbed page, what is the value of the <carrier> element after the first
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step Answer
b.
On the Audit Trail tabbed page, expand the <payload> entry under the
receiveInput activity:
c.
d.
e.
The <carrier> element is an empty XML element, for example <carrier/> after the
first copy operation is executed in the Assign_shipstatus activity, as shown in the
following image:
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.
On the Flow tabbed page, scroll down the visual flow and click the
Assign_shipstatus activity icon.
Activity Details
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step Answer
f.
On the Flow tabbed page, click the callbackClient icon. For example:
g.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
11) On the POProcessing Composite page, if needed click the Request tab to initiate the
second test with the D:\labs\files\xml_in\po-small-guitar.xml file
copied into the Input Arguments (XML View) text area. Use the image as a guide:
Note: This time leave the <payOption> value as credit. Do not change any text in
the input. If you require help to perform this task, use the following substeps:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
13) On the Flow Trace page, examine the Trace tree that should resemble the following
flow:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step Answer
b.
Yes, all item elements for the order have been copied to the fulfillmentRequest
variable. The for-each XSL construct in the XSL Transformation used ensures
that repeating elements, such as the item element, are copied to the target XML
structure.
Note: An Assign activity would require a copyList operation or need to use the
copyList XSL function to accomplish similar results.
c.
The Assign_orderinfo activity first copied the order elements from the
inputVariable to the outputVariable, and the Transform_fulfillment activity used a
transformation to copy the outputVariable values to the fulfillmentRequest
variable.
d.
Yes. If the outputVariable, which is being used as a working copy of the order
data, was modified after it was assigned its data in the Assign_orderinfo and
before the Transform_fulfillment activity is executed the data in the
fulfillmentRequest variable can differ from the inputVariable.
Note: At this stage, the BPEL process does not modify the outputVariable before
it is copied to the fulfillmentRequest variable.
15) Close the Flow Trace Web browser window.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In part one the following image illustrates the changes you make to the ApproveCCOrder
BPEL Process component:
Creating three partner links, one for each reference to a JMS Adapter representing
the service for shipping companies. The JMS Adapters for the three shipping
companies (UPS, USPS, and FedEx) are created as External References in the
composite application or Partner Links in the BPEL process component.
Adding a Switch activity to check the shipMethod element of the inputVariable
and select a different JMS Adapter service to invoke based on its value.
Note: This choice of shipping company service to be invoked is later changed to a
business rules implementation.
Invoking the different JMS Adapters within branches of the Switch activity.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Part 1
3) In the Create Web Service window, set Name to ValidateCCService and Type
is Reference. Set the WSDL URL to the CreditCardValidation service by using
the SOA Resource Browser, after which the Port Type will be set to
validateCC_ptt. Use the following screenshot as a guide to configure the
external reference:
Note: If it helps use the following steps to fill in the Create Web Service window:
a) In Name enter ValidateCCService, and accept default Type value of
Reference.
b) To the right of the WSDL URL field, click the Find Existing WSDLs icon (
open the SOA Resource Browser window.
) to
c) In the SOA Resource Browser window, select the Resource Palette option from
the pull-down menu, expand the Application Server > soaserver > SOA >
CreditCardValidation [1.0] (soa_server1) entry, select ValidateCreditCard_ep and
click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) In the Create Web Service window, the WSDL URL is populated with your
selection from the SOA Resource Browser window and the Port Type is
populated with the validateCC_ptt option, which is the only possible value for this
service endpoint. Click OK to create the external reference.
4) In the composite.xml window, verify that the external reference icon has been
added as shown in the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: Creating the wire from the ApproveCCOrder BPEL Process component to the
ValidateCCOrderService has also created a partner link in the
ApproveCCOrder.bpel file.
As shown in the above image, you can verify the partner link is created if you open
the ApproveCCOrder.bpel file, which can be done by double-clicking the
ApproveCCOrder.bpel file (in the Application Navigator) or the double-clicking
ApproveCCOrder BPEL Process component icon.
6) Verify that your composite application, shows the addition of the ValidateCCService
external references wired to the ApproveCCOrder BPEL Process component, as
shown in the following image,
7) Save the changes to your composite application and the ApproveCCOrder BPEL
component.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you edit the ApproveCCOrder BPEL process to implement activities for
credit card validation in the Scope_validatecc. The following image shows the resulting
changes to the BPEL process flow:
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.
To complete this task, perform the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
1) Open the ApproveCCOrder BPEL Process component file in the BPEL Editor.
Note: You may already have the BPEL file open due to verifying the presence of the
ValidateCCService partner link in step 5) of the previous practice in this lesson titled
Create the CreditCardValidation External Reference.
In this section you create the typical activity flow for a synchronous service invocation,
which contains an Assign activity followed by an Invoke activity. What occurs after the
Invoke activity depends on how the response data is used by the process. In this case, you
check the results with Switch activity.
Note: The Invoke activity is configured first because it creates the variable needed for the
Assign activity that is added before the Invoke activity.
2) In the ApproveCCOrder.bpel Design window, locate and expand the
Scope_validatecc activity, and delete the existing Empty activity contained within the
scope. In the Confirm Delete window, click Yes.
3) In the ApproveCCOrder.bpel Design window, inside the Scope_validatecc
activity create three named activity types in the order that they are listed in the
following table:
Activity Type
a. Assign
Activity name
Assign_ccinfo
b. Invoke
Invoke_validatecc
c. Switch
Switch_ccvalid
Purpose
Assign credit card number to
the credit card validation
service request variable.
Invoke the credit card
validation service.
Check the response from the
credit card validation service.
Note: Use the following image as a guide to the resulting process flow within the
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scope_validatecc activity:
If you require help to perform the task of constructing the flow inside the
Scope_validatecc activity, perform the following steps:
a) Drag an Assign activity from the Component Palette into the expanded
Scope_validatecc activity.
b) Double-click the Assign activity name and rename it to Assign_ccinfo.
c) Drag an Invoke activity from the Component Palette and drop it inside
Scope_validatecc after the Assign_ccinfo activity.
d) Double-click the Invoke activity name and rename it to Invoke_validatecc.
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.
In this section, you first configure the Invoke activity to invoke the ValidateCCService,
which involves linking the Invoke activity with ValidateCCService partner link and
creating variables to communicate the request data and receive the response.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
a.
Edit Invoke
b.
Create Variable
Choices or Values
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.
Accept the default variable name, select the Local
Variable option, and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Create Variable
e.
Edit Invoke
Choices or Values
On the right of the Output field, click the
Automatically Create Output Variable icon ( )
Accept the default variable name, select the Local
Variable option, and click OK.
Verify your Invoke activity settings and that both the
Input and Output fields contain a variable name.
Click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d)
e)
Note: When you click OK the Errors indicator should be removed, provided you
have correctly configured the Invoke activity settings.
7) Save the changes to the BPEL process.
Now that the input variable has been created for the Invoke activity, you can populate the
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Copy the cardNumber element in the order element of the process inputVariable
to the CCNumber element of the CreditCheckRequest in the
Invoke_validatecc_validatecc_inputVariable.
Note: Remember you created Invoke_validatecc_validatecc_inputVariable as
local variable in Scope_validatecc. Use the following screenshot as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Copy the orderTotal element in the order element of the process inputVariable to
the amount element of the CreditCheckRequest in the
Invoke_validatecc_validatecc_inputVariable. Use the following image as a guide:
c) In the Assign window, verify that your two copy operations have been created and
click OK.
In this section, configure the Switch <case> condition to check if the response message
received through the Invoke_validatecc activity contains the string VALID.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) In the Condition Expression window, click the XPath Expression Builder icon (
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
13) In the Expression Builder window, create an XPath expression that compares if the
status element in the Invoke_validatecc_validateCC__OutputVariable > reply >
CreditCheckResponse tree is equal to the string literal uppercase value 'VALID'.
Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section, configure the activity sequence in the Switch <case> branch to execute the
Scope_fulfillment for VALID credit card orders.
16) In the ApproveCCOrder.bpel Design window, collapse the Scope_fulfillment
activity and drag it into the <case> branch of the Scope_validatecc activity. Use the
following image as a guide:
Note: It is easier to drag the Scope when it is in the collapsed state. However, the
BPEL Editor expands the Scope_fulfillment activity after it is dropped in the <case>
branch.
17) Save the changes to your BPEL process.
In this section, configure the activity sequence in the Switch <otherwise> branch to
execute an Assign activity that sets the outputVariable status element to indicate that the
credit card is not valid.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
18) In the ApproveCCOrder.bpel Design window, drag an Assign activity into the
<otherwise> branch of the Scope_validatecc activity.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
20) Edit the Assign_invalidcc activity and create one copy operation, which copies the
literal string expression invalid credit card to the status element in the
outputVariable process variable. Use the following image as a guide:
21) In the Assign window, verify the copy operation is created and listed and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
22) In the ApproveCCOrder.bpel Design window, verify that your process flow
contains the Scope_fulfillment activity in the Switch <case> branch and the
Assign_invalidcc activity in the <otherwise> branch. Use the following image as a
guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you expand the Scope_fulfillment activity and create an activity sequence
for an asynchronous invocation pattern to invoke the Fulfillment BPEL Process for orders
with a valid credit card. You use an Assign activity copy the response from the
Fulfillment service to the order status in the outputVariable. The response value
completed indicates the order has been shipped. The status value waiting indicates
some or all the ordered products are out of stock and cannot be shipped.
Note: Remember you have already created the fulfillmentRequest and
fulfillmentResponse variables in the scope for interaction (exchanging input and output
data, respectively) with the Fulfillment BPEL process. Therefore when you configure the
Invoke activity you browse for and use the existing variables instead of automatically
creating new variables. In addition, the Scope_fulfillment activity contains a Transform
activity that has already initialized the input data in the fulfillmentRequest variable.
To complete this task perform the following steps:
1) In the ApproveCCOrder.bpel Design window, if needed, expand the
Scope_fulfillment activity in the <case> branch of the Switch_validatecc activity.
In this section you create Invoke, Receive, and Assign activities to form the sequence
needed to asynchronously interact with the Fulfillment BPEL process.
Activity Name
Invoke_fulfillment
Receive_fulfillment
Assign_fulfillment_status
Note: Use the following image as a visual aid to the layout and sequence of the
activities in the Scope_fulfillment activity:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Part 2
If you require help to create the flow, then perform the following steps:
a) Drag an Invoke activity into Scope_fulfillment and drop it after the
Transform_fulfillment activity. Rename the Invoke activity to
Invoke_fulfillment.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
Invoke
d.
Variable Chooser
e.
Invoke
Choices or Values
Partner Link: Click the Browse Partner
Links icon ( )
In the Process > Partner Links tree select
Fulfillment.fulfillment_client, and click OK.
Note: The Operation field is set to
process, the only operation provided by
the Fulfillment service.
Input: Click the Browse Variables icon ( )
In the Process > Scope Scope_validatecc >
Scope Scope_fulfillment > Variables tree,
select fulfillmentRequest and click OK.
Note: Since the Fulfillment service is
asynchronous you cannot specify an output
variable for the response. Therefore, a
Receive activity is used to get the response.
Verify your settings and click OK.
Note: An alternative way to do steps a) and b) is to drag a line connecting the rightedge Invoke Settings icon from the Invoke_fulfillment activity to the Fulfillment
partner link. However, the table of instructions is suggested to avoid scrolling the
window to accommodate the drag and drop approach.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
9) In the Edit Receive window, browse for and select fulfillmentResponse for the
Variable to receive the response data from the Fulfillment service.
Hint: Click the Browse Variables icon ( ), and in the Variable Chooser and select
the fulfillmentResponse variable in the nest Scope called Scope_fulfillment. Use the
following image as a guide to the Invoke activity settings:
The Fulfillment BPEL service returns a shipStatus and carrier response values. In this
section you configure the Assign activity to copy the shipStatus from the
fulfillmentResponse to the process outputVariables 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
11) Configure the Assign_fullfillment_status activity with a copy operation that copies
the shipStatus from the fulfillmentResponse variable to the outputVariable order >
status element. Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) Verify that your Scope_fulfillment activity sequence resembles the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you modify the Fulfillment BPEL Process by creating and configuring
three JMS Adapter partner links, one for each shipping company: UPS, USPS, and
FedEx. The following image shows how you modify the process flow with a Switch to
check the shipMethod chosen by the customer and create the order shipping request
message for an invoke activity for each JMS Adapter:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) On the Component Palette, click the BPEL Services pane to expose the adapter
component icons, among others.
b) In the Fulfillment.bpel Design window, drag the JMS Adapter from the
Component Palette into the right-hand Partner Link column.
Note: This opens the Adapter Configuration Wizard window.
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
a.
Welcome
b.
Service Name
Choices or Values
Click Next.
Service Name: UPSJmsService
Click Next.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
Server Connection
e.
Adapter Interface
f.
Operation
g.
h.
Messages
i.
Finish
Choices or Values
Select the Oracle Enterprise
Messaging Service (OEMS) option and
the Oracle WebLogic JMS option from
the pull-down menu.
Click Next.
Connection exists in: Select the Resource
Palette option
Connection: soaserver
Click Next.
Accept the default Define operation and
schema (specified later) option
Click Next.
Operation Type: Select the Produce
Message option.
Operation Name: Accept the default value of
Produce_Message
Click Next.
Destination Name (Queue):
jms/demoFulfillmentQueue
JNDI Name: eis/demo/Queue
Accept default settings for other fields.
Click Next.
Note: To set the Destination field click Browse
and select the queue name from the Select
Destination window. Manually change the
JNDI Name as specified.
URL: xsd/fulfillment.xsd
Schema element: ShippingRequest
Click OK when done. However, first read the
following note:
Note: To set these values click the Browse
icon ( ) next to the URL field and in the
Type Chooser select the ShippingRequest
element under the Project Schema files >
fulfillment.xsd.
Click Next.
Click Finish.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
g) To select the Destination click Browse next to the Destination Name (Queue)
field and on the Select Destination window, scroll down and select
demofulfillmentQueue under the SOAJMSModule folder, and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
h) On the Messages page, click the Browse icon ( ) to display the Type Chooser
where you can select the ShippingRequest element from the
internalorder.xsd (either nested in the fulfillment.xsd or the
Project Schema Files folders):
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
i)
4) In the Create Partner Link window, which is displayed after completing the steps in
the Adapter Configuration Wizard, accept the default settings as shown in the
following image and click OK:
5) In the Fulfillment.bpel Design window, confirm that the partner link for the
JMS Adapter exists in the Partner Link column the right-side of the window.
6) Click on the POProcessing composite.xml window, and observe that a wire has
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
8) In the Fulfillment.bpel Design window, create a JMS Adapter partner link and
using the Adapter Configuration Wizard configure the second JMS Adapter as the
USPS service by using instructions in the following table (no screenshots are
provided):
Step Screen/Page Description
a.
Welcome
b.
Service Name
c.
JMS Provider
d.
Server Connection
e.
Adapter Interface
f.
Operation
g.
Produce Operation
Parameters
h.
Messages
i.
j.
Finish
Create Partner Link
Choices or Values
Click Next.
Service Name: USPSJmsService
Click Next.
Select the Oracle Enterprise Messaging
Service (OEMS) option and the Oracle
WebLogic JMS option from the pull-down menu.
Click Next.
Connection exists in: Select the Resource
Palette option.
Connection: soaserver
Click Next.
Accept the default Define operation and schema
(specified later) option.
Click Next.
Operation Type: Select the Produce Message
option.
Operation Name: Accept the default value of
Produce_Message
Click Next.
Destination Name (Queue):
jms/demoFulfillmentQueue
JNDI Name: eis/demo/Queue
Accept default settings for other fields.
Click Next.
URL: xsd/fulfillment.xsd
Schema element: ShippingRequest
Note: If you click the Browse icon to select the
schema element, then click OK.
Click Next.
Click Finish.
Click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
JMS Provider
d.
Server Connection
e.
Adapter Interface
f.
Operation
g.
Produce Operation
Parameters
h.
Messages
i.
j.
Finish
Create Partner Link
Choices or Values
Click Next.
Service Name: FedExJmsService
Click Next.
Select the Oracle Enterprise Messaging
Service (OEMS) option and the Oracle
WebLogic JMS option from the pull-down menu.
Click Next.
Connection exists in: Select the Resource
Palette option
Connection: soaserver
Click Next.
Accept the default Define operation and schema
(specified later) option
Click Next.
Operation Type: Select the Produce Message
option
Operation Name: Accept the default value of
Produce_Message
Click Next.
Destination Name (Queue):
jms/demoFulfillmentQueue
JNDI Name: eis/demo/Queue
Accept default settings for other fields.
Click Next.
URL: xsd/fulfillment.xsd
Schema element: ShippingRequest
Note: If you click the Browse icon to select the
schema element, then click OK.
Click Next.
Click Finish.
Click OK.
11) Save the changes to the BPEL process and to the POProcesing composite application.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) In the POProcessing composite.xml window, verify that the assembly model
resembles the following image:
Note: The Fulfillment BPEL Process component has three wires, where each wire is
linked to a different JMS adapter external reference. Remember, you could have also
created and configured the JMS Adapters as external references in the
composite.xml and wired them to the Fulfillment BPEL Process component to
yield the same results.
Add a Switch to Choose the JMS Adapter for the Shipment Request
In 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: Only if you require help to create the flow sequence in the Scope_shiporder
activity, perform the following steps:
a) Drag a Switch activity as the first activity in Scope_shiporder.
b) Rename the Switch activity Switch_shiporder.
c) Expand the Switch_shiporder activity.
d) To the left of the Switch_shiporder activity icon, click the Add Switch Case icon
( ) twice to create two new <case> branches:
Note: Alternatively, right-click the <case> title bar and select Edit.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Switch Case window in the General tab page, enter UPS in Name.
Note: The value in the Name field becomes a useful visual indicator in the <case>
branch title after you complete this step.
To create the Expression, click the XPath Expression Builder icon ( ) to
construct a conditional expression comparing if the inputVariable > payload >
FulfillmentRequest > shipMethod element is equal to the lower case string literal
'two_day'. For example:
bpws:getVariableData('inputVariable','payload',
'/ns1:FulFillmentRequest/ns5:shipMethod') = 'two_day'
Click OK after both fields are completed. Use the following image as a guide:
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 (
the Expression field.
) for
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Switch Case window in the General tab page, enter USPS 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 'five_day'. For example:
bpws:getVariableData('inputVariable','payload',
'/ns1:FulFillmentRequest/ns5:shipMethod') = 'five_day'
Click OK after both fields are completed. Use the following image as a guide:
17) Configure third right-most <case> branch name and condition expression for the
FedEx service by performing the following steps:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
18) Save the changes to your Fulfillment BPEL Process, after verifying that your
Switch_shiporder activity appears as shown in the following image:
Note: The names UPS, USPS, and FedEx (as specified in each of the Switch Case
settings) now appear as visual annotations in the title for each <case> branch.
In this section, you create a variable called shippingRequest whose type is the
ShippingRequest element in the projects 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
19) With the Scope_shiporder activity expanded, click the Variables icon, and in the
Create Variables window add a new variable called shippingRequest whose type is
the ShippingRequest element in the projects fulfillment.xsd file. Use the
following image as a guide:
Note: Only if you require help to create the variable, perform the following steps:
a) On the expanded Scope_shiporder, click the Variables icon (
b) In the Variables window, click the Create icon (
).
).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
20) In the Fulfillment.bpel Design window, drag an Assign activity into the
Scope_shiporder scope before the Switch_shiporder activity. Rename the Assign
activity to Assign_shiporder. Use the following image as a guide:
21) Configure the Assign_shiporder, with three copy operations to initialize the contents
of the shippingAddress variable (in the Scope_shiporder). Use the following steps
(and their associated screenshots as a guide):
a) Create a copy operation that copies the orderId element in the inputVariable to the
orderId element in the shippingRequest variable:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Create a copy operation that copies the customerId element of the inputVariable,
to the custName element in the shippingRequest variable:
c) Create a copy operation that copies the following XML Fragment into the
shippingAddress element of the shippingRequest variable:
<ns0:shippingAddress
xmlns:ns0="http://www.example.org/ns/fulfillment">
<ns0:street></ns0:street>
<ns0:city></ns0:city>
<ns0:state></ns0:state>
<ns0:zip></ns0:zip>
<ns0:country></ns0:country>
</ns0:shippingAddress>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: At this stage, since service and associated activities for obtaining the
customer address data have not been created, you initialize the XML address
elements to the empty elements shown. To save time, open the file
D:\labs\files\xml\shipAddress.xml and copy the contents into the
XML Fragment area of the copy operation. Observe that the Type in the From
section is set to XML Fragment.
Note: When copying an XML fragment the XML Namespace prefix and its
associated path are required to preserve the BPEL process source XML structure.
22) Save the changes to your BPEL Process.
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
a. Assign
b. Invoke
Activity Name
Assign_toUPS
Invoke_UPS
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
24) Configure the Invoke_UPS activity to execute the Produce_Message operation of the
UPSJmsService, and use the Automatically Create Input Variable icon to create a
local variable, by performing the following steps:
a) Drag a line from the Invoke_UPS activity to the UPSJmsService
b) In the Edit Invoke Activity window, click the Automatically Create Input
Variable icon, and in the Create Variable window ensure the Local Variable
option is selected. Click OK.
25) Configure the Assign_toUPS activity with the following three copy operations:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Copy the ShippingRequest element from the shippingRequest variable into the
ShippingRequest element of the Invoke_UPS_Produce_Message_InputVariable.
Note: Both variables are nested in the Scope called Scope_shiporder.
b) Append the literal string ' (UPS)' including the leading space to the custName
element in the Invoke_UPS_Produce_Message_InputVariable.
Note: Appending the carrier text to the customer name is included here so that
you can see the carrier used in the shipping message received by the JMS message
consumer application that you use in the testing section of this practice. In this
case use the following steps to create an Append Operation:
i) In the Assign window, click the Create icon (
Operation.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
ii) In the Create Append Operation window, in the From section use
Expression for the Type and enter ' (UPS)' in the Expression field. In the
To section use Variable as the Type and select the custName child element
in the Invoke_UPS_Produce_Message_InputVariable as the target.
c) Copy the literal string expression '(UPS)' into the carrier element in the
process outputVariable.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) Copy the literal string expression completed into the shipStatus element in the
process outputVariable.
In this section, you create an Invoke activity to invoke the USPSJmsService and Assign
with multiple copy operations preparing the JMS service request message. In the same
Assign activity create copy operations to set 'USPS' as the carrier and 'completed'
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
a. Assign
b. Invoke
Activity Name
Assign_toUSPS
Invoke_USPS
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
28) Configure the Invoke_UPS activity to execute the Produce_Message operation of the
USPSJmsService, Use the Automatically Create Input Variable icon to create a local
variable, by performing the following steps:
a) Drag a line from the Invoke_USPS activity to the USPSJmsService
b) In the Edit Invoke Activity window, click the Automatically Create Input
Variable icon, and in the Create Variable window ensure the Local Variable
option is selected. Click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
29) Configure the Assign_toUSPS activity with the following three copy operations and
one append operation:
a) Copy the ShippingRequest element from the shippingRequest variable into the
ShippingRequest element of the Invoke_USPS_Produce_Message_InputVariable.
Note: Both variables are nested in the Scope called Scope_shiporder.
b) Append the literal string ' (USPS)' including the leading space to the
custName element in the Invoke_USPS_Produce_Message_InputVariable. Use
the following steps:
i) In the Assign window, click the Create icon (
Operation.
ii) In the Create Append Operation window, in the From section use
Expression for the Type and enter ' (USPS)' in the Expression field. In the
To section use Variable as the Type and select the custName child element
in the Invoke_USPS_Produce_Message_InputVariable as the target.
c) Copy the literal string expression 'USPS' into the carrier element in the process
outputVariable.
d) Copy the literal string expression 'completed' into the shipStatus element in
the process outputVariable.
30) Save the changes to your BPEL Process.
In this section, you create an Invoke activity to invoke the FedExJmsService and Assign
with multiple copy operations to prepare the JMS service request. In the same Assign
activity create copy operations to set 'FedEx' as the carrier and 'completed' as the
status in the outputVariable.
31) Inside the <case FedEX> branch, create the sequence of case-sensitively named
activities listed in the following table:
Activity Type
a. Assign
b. Invoke
Activity Name
Assign_toFedEx
Invoke_FedEx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
33) Configure the Assign_toFedEx activity with the following three copy operations and
one append operation:
a) Copy the ShippingRequest element from the shippingRequest variable into the
ShippingRequest element of the
Invoke_FedEx_Produce_Message_InputVariable.
Note: Both variables are nested in the Scope called Scope_shiporder.
b) Append the literal string ' (FedEx)' including the leading space to the
custName element in the Invoke_FedEx_Produce_Message_InputVariable. Use
the following steps:
i) In the Assign window, click the Create icon (
Operation.
ii) In the Create Append Operation window, in the From section use
Expression for the Type and enter ' (FedEx)' in the Expression field. In
the To section use Variable as the Type and select the custName child
element in the Invoke_FedEx_Produce_Message_InputVariable as the target.
c) Copy the literal string expression 'FedEx' into the carrier element in the
process outputVariable.
d) Copy the literal string expression 'completed' into the shipStatus element in
the process outputVariable.
34) In the Fulfillment.bpel Design window, verify that your Scope_shiporder has
the BPEL Process flow represented in the following image:
35) Save the changes to your BPEL Process and the POProcessing project.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you deploy the modified POProcessing composite application and initiate
at least three tests instances with different input data. The three test cases include:
Sending an order with a valid credit card
Sending an order with an invalid credit card
Sending an order with a different ship method to the first test
Note: While only three tests are done to cover the two conditions for credit cards and at
least on alternative for the ship choice, if there was time one could perform an additional
two more test to cover the remaining variations of ship methods available. All test cases
are initiated through the Oracle Enterprise Manager Web interface.
To complete the testing tasks, perform the following steps
1) Using JDeveloper, deploy the POProcessing project to the soaserver connection.
When the SOA Deployment Configuration Dialog window is displayed select the
Overwrite any existing composites with the same revision ID. Option.
Note: If the Authorization Request window is displayed, enter the username
weblogic and password welcome1. Ensure the composite application is
successfully deployed.
2) In a Web browser window, enter the Oracle Enterprise Manager URL
http://localhost:7001/em. If required login with Username: weblogic with
Password: welcome1.
3) On the Oracle Enterprise Manager home page, locate and click the deployed
POProcessing [1.0] composite application link (located under the SOA tree in the
Farm navigation pane).
4) On the POProcessing [1.0] page, click Test.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Was the order processed by the Fulfillment BPEL process? Explain how you
verified your answer.
b) Which JMS Adapter service received the shipping request, and why was the
specific JMS Adapter used?
c) In the Audit Trail or the Flow tabbed page for the ApproveCCOrder, which
activity receives the response from the ValidateCCService? What is the response
messaged child element name that contains the validation information, and what
validation value was returned?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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.
The child element containing the validation information is the <inp1:status> element,
and the value returned is the string value VALID.
7) Close the Web browser window containing the Flow Trace, Audit Trail or Flow
tabbed page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Application Navigator, click the application name and select Open
Application.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
To simplify management and handling of JMS message delivery and consumption during
the rest of the practices, you deploy the supplied JMSConsumerDemo project, which is a
composite application that:
Reads the JMS messages produced by JMS Adapters in the POProcessing
composite application.
Writes the shipping request JMS message to a file called shiporder_#.xml, where
# represents a number that is incremented for each message file created. There is
one message file per message and the files are stored in the D:\temp folder.
The following image shows the component assembly model for the JMSConsumerDemo
composite application:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) What was the status response text received by the Invoke_validatecc activity?
c) What is the orders status value returned in the callbackClient activity for the
ApproveCCOrder BPEL process?
d) Look in the D:\temp folder. Was any shiporder_#.xml file created?
Explain what you discovered.
The Fulfillment was not invoked by the ApproveCCOrder BPEL process because
the credit card was not valid and Switch activity that checks the
ValidateCCService response executed the <otherwise> branch, as seen in the Flow
tabbed page for the ApproveCCOrder BPEL component link:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
The status value returned by the callbackClient activity is invalid credit card as
seen in the expanded <payload> of the callbackClient activity in the Audit Trail
tabbed page for the ApproveCCOrder activity.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
For this test you reuse the D:\labs\files\po-small-ipod.xml file as input and
alter the ship method value to the value five_day before you click Test Web Service.
This will check if the order is sent to a different JMS Adapter service from the first test.
17) To run the third and last test, perform these steps:
a) In the JDeveloper Application Navigator, expand the files > xml_in project
folders and double-click the po-small-ipod.xml file. Copy all the text in the
file into the clipboard, and paste the text into the Request tab Input Arguments
section, select the XML View, of the on the POProcessing [1.0] Web browser
page.
b) Edit the XML elements in the data in the XML View area such that:
The <ns0:shipChoice> element contains the value five_day.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
18) On the Response tab, click the Launch Message Flow Trace link to display the
following Flow Trace page for the test instance and answer the following questions:
a) To which JMS Adapter service was the order shipping request sent?
b) Why is the JMSConsumer_ep entry shown below the Fulfillment BPEL
Component entry in the Flow Trace?
c) Why are the RouteOrder and the associated FulfillmentFileService components
present in the Flow Trace?
d) Was a shiporder_#.xml file created in the D:\temp folder?
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: Part 2 depends on the completion of part 1 tasks. If you do not have enough time,
then consider deploying the solution projects from the POApplication.jws
workspace in the D:\labs\soln\lesson09\POApplication folder for part 1
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
implemented by replacing the Receive activity with Pick activity and associated
process flow alterations.
Modify the supplied OnlineStore composite application to use a FlowN activity to
process more than one product per order.
Deploy and test the InternalStore and ExternalStore applications
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Select Deployment Targets window, select soa_server1 and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) On the Resource Palette, expand the WSIL > WSILConnection1 entry, and verify
that the InternalStoreSDO_InternalStoreSDOProfile and
OnlineStoreSDO_OnlineStoreSDOProfile entries are present.
Note: You may have to right-click the WSILConnection1 entry and select
Refresh to ensure the deployed applications become visible.
6) Test the InternalStoreService with the Test Web Service tool in JDeveloper. Use the
following steps:
a) On the Resource Palette, right-click the InternalStoreService entry, and click Test
Web Service.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
InternalStoreServiceSoapHttpPort.getInternalStoreView1(,)
from the Operations pull-down menu, in the prodId: string field (in the left
window pane) enter: SKU101, and click Send Request.
Note: JDeveloper displays the following message while sending the message and
waiting for the response.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Operations pull-down menu, in the prodId: string field (in the left window
pane) enter: SKU101, and click Send Request.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you open the InternalStore composite application project, which is
located in the D:\labs\files folder. You modify the ManageInventory BPEL
Process by:
Replacing the Receive activity with a Pick and two onMessage branches, each
one to handle one of two operations checkStock and acquireStock defined in the
component WSDL. In this case, you set a variable to indicate which operation
was requested so that the process flow can manage the request appropriately.
Adding a While loop and associated iteration control activities to process multiple
product elements and check if stock exists. Activities that obtain the amount of
available stock are also needed for the acquireStock operation so that you can
decrement the amount of stock available by the amount ordered for the operation
that updates the information in the database table.
Implementing Switch statements to execute different actions for the different
operations and ensure appropriate responses are returned.
To complete this task, perform the following steps:
In this section you copy the InternalStore composite application project into your
POApplication workspace folder, and open the project in the POApplication.
1) Open a Windows Explorer window, and copy the
D:\labs\files\InternalStore folder to the
D:\labs\mywork\POApplication folder.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3) Expand the InternalStore project and open the composite.xml file. Using the
image as a guide answer the questions that follow:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Now examining the process flow at the end of the BPEL process which contains a
Switch activity as shown in the following image answer the additional questions:
e) What does the <case inStock> branch condition test, and what are the actions for
each of the condition outcomes?
Step Answers for step 5
a.
The Invoke_checkinstore invokes the getInternalStoreView1 operation.
Hint: Double-click the Invoke activity to view the settings.
Note: The operation accepts a product ID as the input message and returns the
product ID and quantity available from the database (INTERNAL_STORE table).
b.
The Assign_prodid copies the prodId element from the first product element of the
input structure to the request message used by the invocation of the
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section you restructure the BPEL process flow to include a While activity to loop
through the set of products received for processing and set the While activity termination
condition. This requires modifying the Assign_initialize activity to modify the loop
counter, and moving activities into the loop, decrementing a loop counter.
Note: The While loop is terminated either when all products are processed or the first
product that is out of stock is encountered. You also have to modify the XPath expression
in the Assign_prodid and Assign_prodinstock copy operations to dynamically access the
nth element in the XML array structure.
6) In the ManageInventory.bpel window, restructure the BPEL flow according to
the following image:
To create the flow changes represented in the image perform the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Expand the While activity and add a Sequence activity into the body of the While
activity.
c) Drag the Assign_prodid, Invoke_checkinstore, and Assign_prodinstock activities
(in the order stated) into the body of the Sequence_1 activity nested in the While
activity.
d) After verifying that your process flow resembles the image provided above, save
your structural changes to the BPEL process.
7) Create a process variable called n based on the Simple Type option set to xsd:int.
This variable is used to control the number of loop iterations and index the product
element in the input XML structure. Use the following image as a guide:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c) In the Create Copy Operation window, in the From section set Type as
Expression and construct the following Expression:
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:
bpws:getVariableData('n') > 0 and
bpws:getVariableData('inStock') = true()
Note: Remember the Assign_initialize has already preset inStock to the value
true() to ensure that you enter the while loop. Use the following image as a guide:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
iv) At the end of the expression append the text = true() (excluding the
double quotes).
v) Click OK.
d) In the While window, click OK to save the conditional expression.
e) Save the changes to your BPEL process.
10) Modify the copy operation in the Assign_prodid activity so that you replace the
absolute index [1], in the XPath expression, with the string [position()=$n].
Note: The dollar ($) character preceding the character n is required. Use the
following screenshot as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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:
Note: The simplest way to change the From Expression is to select the digit 1
between the square brackets and replace it with the highlighted text
position()=$n.
12) You require one more Assign activity in the While sequence to decrement the value
of the variable n by a value of one at the end of the loop. Use the following image as
a guide:
a) Drag an Assign activity as last activity in the Sequence inside the While activity.
b) Rename the Assign activity to Assign_next_n.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
13) Configure the Assign_next_n activity to decrease the value in the variable n by one,
and assign the result back to the variable n. Use the following screenshot as a guide:
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:
Oracle SOA Suite 11g: Build Composite Applications 248
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) On the Pick > General settings page, replace the Name with Pick_operation,
select the Create Instance option, and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
If you require help to perform this task, perform the following steps:
a) Double-click the first (left-most) onMessage branch icon.
b) In the OnMessage Branch window, configure the following settings:
Partner Link: manageinventory_client (Click the Browse icon to select
the partner link)
Operation: checkStock
Variable: inputVariable (Click the Browse icon to select the variable)
Click OK.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Location
In the left OnMessage Branch
In the right OnMessage Branch
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
23) Configure the Assign_checkstock with a copy operation that stores the string literal
check in the operation variable. Use the image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
24) Configure the Assign_acquirestock with a copy operation that stores the string literal
acquire in the operation variable. Use the image as a guide:
The While loop needs the Assign_prodinstock to be executed when the operation=check,
and different activities when operation=acquire. To make this change you add Switch
activity, into the While loop, with a conditional expression on the operation variable and
configure its <case> and <otherwise> branches with appropriate activities for each
operation.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
26) In the ManageInventory.bpel Diagram, drag a Switch activity into the While
activity Sequence between the Invoke_checkinstore and Assign_prodinstock
activities. Rename the Switch activity to Switch_operation. Use the following image
as a guide:
27) Expand the Switch_operation to structure the <case> branch and <otherwise> branch
as described by the following steps:
a) Drag the Assign_prodinstock activity into the <case> branch.
b) In the <otherwise> branch, add the following activities in the sequence listed:
i) Drag a new Assign activity renamed to Assign_updstock.
ii) Drag a new Invoke activity renamed to Invoke_updstock.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
28) Configure the <case> branch name to operation=check and set the conditional
expression to ensure that the operation variable is equal to the literal string
'check', as shown in the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
29) Link the Invoke_updstock with the InternalStoreService, using the drag and drop
technique or double-click the activity and set the partner link to InternalStoreService
and select updateInternalStoreView1 as the Operation. For the Input and Output use
the Automatically Create Input (or Output) Variable icons, respectively to create the
required variables as Global Variables. Use the following image as a guide to the
Invoke settings:
30) Configure the Assign_updstock with the following two copy operations:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Copy the nth products prodId element to the corresponding element in the
Invoke_updstock_updateInternalStoreView1_InputVariable. Use the following
image as a guide:
Note: To set the correct XPath expression for the nth product, perform the
following steps in the From section:
i) Select the Type as Variable.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
31) Verify that your While loop contains the following changes to its activity sequence,
and save the changes to your BPEL process:
In this section the final change you make to the ManageInventory BPEL Process is to
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
32) In the ManageInventory BPEL Diagram window, create a new Switch called
Switch_response outside the While activity between the While and existing Switch
activity at the end of the process. Use the following image as a guide:
33) Expand the Switch_response activity and configure the <case> branch conditional
expression to check if the operation variable is equal to the literal string check. Use
the following image as a guide:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
35) Configure the Assign_fulfilled activity with a copy operation that stores the literal
string fulfilled in the outputVariable status element. Use the following image as a
guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
37) Close and reopen the ManageInventory.bpel file and verify that the final
Switch activity flow sequence resembles the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you open and modify the ManageStock BPEL Process implementation in
the OnlineStore composite application, and answer some questions to facilitate your
understanding of parts of the implementation. The OnlineStore composite assembly
model is similar to the InternalStore application as shown in the following image:
In this section you open and examine the ManageStock BPEL existing implementation
and answer questions so that you can modify the code with some awareness of the
changes required when you implement the FlowN to process multiple products.
Note: If you prefer, to save time you can skip and read the questions at another time.
3) In the Application Navigator, expand the OnlineStore composite project and doubleclick the ManageStock.bpel process to open it in the BPEL Editor.
4) In the ManageStock.bpel Design window, examine the process flow elements
and answer the following questions:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Does the ManageStock BPEL Process support all the operations (checkStock,
checkStockResponse, acquireStock, and acquireStockResponse) defined in
ManageStock.wsdl? Explain your answer.
b) What does the Assign_prodid activity do?
c) What does the Assign_newqty activity do? Explain why?
Hint: There are two reasons. By examining the Assign_updstock_data activity in
the <case Acquire Stock?> branch of the Switch_acquirestock activity, and the
<case Any out of stock?> branch conditional expression you may find a way to
explain the logic used.
d) Why is the input and output variables for the Invoke_checkstore and
Invoke_updstock defined as local variables in the Scope_stockprocess scope?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
7) To edit and configure the FlowN_1 activity settings, double-click FlowN_1 activity
icon and perform the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Flow settings window, next to the N field, click the XPath Expression
Builder icon ( ) to define an expression that initializes the variable n to the
count of product elements in the inputVariable. Use the following Expression
Builder image as a guide to creating the expression:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: The Scope_stockprocess activity expands when your drop it into the
sequence above. The image shows the scope in a collapsed state for readability.
10) Save the changes to your BPEL process.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the second copy operation, with qtyOrdered, replace the string [1], in From
XPath expression, with the string [position()=$n]. Use the image as a
guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you deploy and test if the modified InternalStore and OnlineStore
composite applications operate as expected, before you make use of them in the
Fulfillment BPEL Process of the POProcessing composite application. To complete these
tasks perform the following steps:
1) In the JDeveloper Application Navigator window, ensure that the POApplication and
its projects are displayed.
In this section you perform two SQL queries to view the existing stock for three of the
products the database tables for the InternalStore and OnlineStore. The database tables
queried are called INTERNAL_STORE and ONLINE_STORE, respectively.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) In the Application Navigator, expand the files > Application Sources > sql folder,
and right-click int_store_query.sql and select Open. Alternatively,
double-click the file name.
Note: The SQL file is displayed in a SQL Worksheet window.
c) In the int_store_query.sql (SQL Worksheet) window, confirm you have
the following SQL statement, and click the Execute Statement icon ( ).
Select * from internal_store
where prod_id in ('SKU101', 'SKU102', 'SKU200');
Use the following image as a guide:
Note: Ensure that the cursor is placed in or at the end of the SQL statement.
d) In the Select Connection window, select the soademo(POApplication)
connection, and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5) In the JDeveloper window, execute a query to check the available stock in the
ONLINE_STORE database table for the same three product IDs: SKU101, SKU102,
and SKU200. Use the SQL statement in the file called
D:\labs\files\onl_store_query.sql in the following steps to perform
this task:
a) In the Application Navigator, under the files > Application Sources > sql folder,
and right-click onl_store_query.sql and select Open. Alternatively,
double-click the file name.
b) In the onl_store_query.sql (SQL Worksheet) window, confirm you have
the following SQL statement, and click the Execute Statement icon ( ). Use the
following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
7) On the Oracle Enterprise Manager SOA home page, expand the SOA folder in the
Farm navigator, and click the InternalStore [1.0] link.
8) On the InternalStore [1.0] page, click Test.
9) On the InternalStore [1.0] Test Web Service page, ensure that the Operation
selected is checkStock, for example:
10) On the InternalStore [1.0] Test Web Service page, under the Request tab 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.
b) On the Flow Trace page, click the ManageInventory BPEL component link.
Note: You might need to refresh the page until you observe the following results
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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, and return to the Test Web Service page.
11) On the InternalStore [1.0] Test Web Service page, click the Request tab again, and
modify the qtyOrdered element value in the second product (prodId value SKU102)
to the value 10, and Click Test Web Service. For example:
a) On the Response tab, click the Launch Message Flow Trace link.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) On the Flow Trace page, observe that the InternalStoreService was invoked twice
(not three times) and click the ManageInventory BPEL component link.
c) On the Instance of ManageInventory Audit Trail page, scroll down and expand
the <payload> for the callbackClient activity at the end of the flow.
i) What is the response in the status element of the callback?
Answer: It should be out-of-stock, as shown in the following image:
Note: For a degree of simplicity in the application scenario, the BPEL process
reports an out-of-stock status if any one of the ordered products cannot be
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.
In this section you perform one test with ordered quantities that are less than the amount
available to check that the stock quantities in the database tables are correctly decreased
by the ordered amount.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) On the InternalStore [1.0] Test Web Service page, select the acquireStock
operation.
13) On the InternalStore [1.0] Test Web Service page, click the Request tab again and
replace all the XML in the XML View with the data from the
D:\labs\files\xml_in\prod-in-store.xml file, and click Test Web
Service.
a) On the Response tab, click the Launch Message Flow Trace link.
Note: In the Flow Trace tree there should be six rows of the InternalStoreService
present.
b) On the Instance of ManageInventory Audit Trail page, scroll down and expand
the <payload> for the callbackClient_fulfilled activity at the end of the flow.
c) What is the response in the status element of the callbackClient_fulfilled?
Answer: It should be fulfilled, as shown in the following image:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Application Navigator, in the files application under the files >
Application Sources > sql folder, and right-click int_store_query.sql and
select Open. Alternatively, double-click the file name.
b) In the int_store_query.sql window, click the Execute Statement icon
( ), and select any of the soademo connections. Verify that you obtain the
following results in the Results tab:
|
Note: The product quantities should be less than 5 for each of the listed products.
There should be two SKU101 products available, three SKU102 products, and
four SKU200 products.
c) Close the int_store_query.sql window.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) On the Flow Trace page, click the ManageStock BPEL component link.
c) On the Instance of ManageStock Audit Trail page, scroll down and expand the
<payload> for the callbackClient activity at the end of the flow.
i) What is the response in the status element of the callback?
Answer: It should be in-stock, as shown in the following image:
ii) Optionally, if you are interested, expand and examine the flow created by the
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
18) On the OnlineStore [1.0] Test Web Service page, click the Request tab again, and
modify the quantity to a value of 10 for the second product (with product ID
SKU102), and click Test Web Service. Use the following image as a guide:
a) On the Response tab, click the Launch Message Flow Trace link.
b) On the Flow Trace page, click the ManageStock BPEL component link.
Note: The OnlineStoreService reference row appears three times.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) Why did three rows with the OnlineStoreService reference appear in the Flow
Trace tree?
Answer: Because the FlowN logic executes the invoke activity in each of the
three branches and the process determines if any product out of stock in a Switch
<case Any out of stock?> branch conditional expression.
e) Close the Flow Trace Web page.
In this section you perform one test with ordered quantities that are less than the amount
available to check that the stock quantities in the database tables are correctly decreased
by the ordered amount.
19) On the OnlineStore [1.0] Test Web Service page, select the acquireStock
operation.
20) On the OnlineStore [1.0] Test Web Service page, click the Request tab again and
replace all the XML in the XML View with the data from the
D:\labs\files\xml_in\prod-in-store.xml file, and click Test Web
Service.
a) On the Response tab, click the Launch Message Flow Trace link.
Note: In the Flow Trace tree six rows of the OnlineStoreService present.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) On the Instance of ManageStock Audit Trail page, scroll down and expand the
<payload> for the callbackClient_fulfilled activity at the end of the flow. What is
the response in the status element of the callbackClient_fulfilled?
Answer: It should be fulfilled, as shown in the following image:
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.
After decreasing the stock quantities in the database you now modify the code to reset the
stock quantity values in the INTERNAL_STORE and ONLINE_STORE tables.
22) In the JDeveloper window, execute the SQL script to reset the quantity values for the
selected set of products in the INTERNAL_STORE and ONLINE_STORE database
table. Use the following steps:
Oracle SOA Suite 11g: Build Composite Applications 284
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Application Navigator, in the files application under the files >
Application Sources > sql folder, and right-click reset_store_data.sql
and select Open. Alternatively, double-click the file name.
b) In the reset_store_data.sql window, click the Run Script icon ( ), and
select any of the soademo connections. Verify that you obtain the following
results in the Results tab:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you create a Flow activity to perform parallel processing of stock
availability checks with the InternalStore and OnlineStore applications. The following
image shows part of the implementation of activities in the Scope_checkstock in the
Fulfillment BPEL Process of the POProcessing composite application:
Note: The InternalStore and OnlineStore composite applications are asynchronous. For
brevity the following activities are not illustrated in diagram within the Switch:
The Assign activities that prepare requests for the invocation of the acquireStock
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.
In this section you create the partner links for the InternalStore and OnlineStore
composite applications.
Note: Do not create partner links for the ADF-BC services called InternalStoreService
and OnlineStoreService.
2) In the Fulfillment.bpel Design window, drag Partner Link (Web
Service/Adapter) component into the Partner Link column on the right side of the
window, and configure the partner link using instructions in the following table and
associated images as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
d.
Fulfillment.bpel
Design
Choices or Values
In the WSDL Settings click the SOA Resource
Lookup icon ( ).
Select Resource Palette from the pull-down menu at
the top. Expand Application Server > soaserver >
SOA > InternalStore [1.0] (soaserver).
Select manageinventory_client_ep, and
click OK.
Note: If the InternalStore entry does not appear in the
Resource Palette, select the File System option and
select the Resource Palette again to refresh the list of
SOA entries displayed.
Observe that the WSDL URL is populated and the
Name and Partner Link Type. Make the following
changes to settings:
Name: Replace ManageInventory with
InternalStore
Partner Role: Select
ManageInventoryProvider
My Role: Select ManageInventoryRequester
Click OK.
Verify that the InternalStore partner link icon has
been added into the right-hand column.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Note: You may have to select the File System option and then select the Resource
Palette again to refresh the list of SOA entries displayed.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
c.
d.
Fulfillment.bpel
Design
Choices or Values
In the WSDL Settings click the SOA Resource
Lookup icon ( ).
Select Resource Palette from the pull-down menu at
the top. Expand Application Server > soaserver >
SOA > OnlineStore [1.0] (soaserver).
Select managestock_client_ep, and click OK.
Note: If the OnlineStore entry does not appear in the
Resource Palette, select the File System option and
select the Resource Palette again to refresh the list of
SOA entries displayed.
Observe that the WSDL URL is populated and the
Name and Partner Link Type. Make the follow
changes to settings:
Name: Replace ManageStock with OnlineStore
Partner Role: Select ManageStockProvider
My Role: Select ManageStockRequester
Click OK.
Verify that the OnlineStore partner link icon has been
added into the right-hand column.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Note: You may need to select the File System option and select the Resource
Palette again to refresh the list of SOA entries displayed.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
d)
In this section, in the Scope_checkstock you create a parallel flow with two branches, and
a Switch to manage the results returned from activities executed in the flow.
5) In the Fulfillment.bpel Design window, expand the Scope_checkstock
activity.
6) In the Scope_checkstock activity, select and delete the Empty activity.
7) Inside the Scope_checkstock activity, create the activities with the name and
sequence listed in the following table:
a.
b.
Activity Type
Flow
Switch
Activity Name
Flow_checkstock
Switch_selectstore
In this section, in the left branch of the Flow activity you create an asynchronous
invocation pattern using an Invoke with the InternalStore checkStock operation, and a
Receive with the checkStockResponse operation. You also create a Transform activity to
prepare the data for the Invoke activity.
10) Inside the Sequence_1 activity of the left-branch of the Flow_checkstock activity
create the following three activities in the sequence listed:
Activity Type
a. Transform
b. Invoke
Activity Name
Transform_internalstore
Invoke_internalstore
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Activity Type
Activity Name
Receive_internalstore
c. Receive
Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Transform settings window, select the inputVariable and its payload
as the Source, and the
Invoke_internalstore_checkStock_InputVariable payload for
the target. Enter the name xsl/Transformation_internalstore for the
Mapper File and click the Create Mapping icon:
c) In the Auto Map Preferences window, accept the default settings and click OK.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
13) To configure the settings for the Receive_internalstore activity, double-click the
Receive_internalstore activity, set Partner Link to InternalStore, set Operation
to checkStockResponse, and click the Automatically Create Variable icon to
create Local Variable with the default name provided. Use the following image as a
guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
14) Verify that your Flow_checkstock is configured with activities and partner links
shown in the following image:
In this section, in the right branch of the Flow activity you create an asynchronous
invocation pattern using an Invoke with the OnlineStore checkStock operation, and a
Receive with the checkStockResponse operation. You also create a Transform activity to
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
a.
b.
c.
Activity Type
Transform
Invoke
Receive
Activity Name
Transform_onlinestore
Invoke_onlinestore
Receive_onlinestore
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the Transform settings window, select the inputVariable and its payload
as the Source, and the
Invoke_onlinestore_checkStock_InputVariable payload for the
target. Enter the name xsl/Transformation_onlinestore for the
Mapper File and click the Create Mapping icon:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
19) To configure the settings for the Receive_onlinestore activity, double-click the
Receive_onlinestore activity, set Partner Link to OnlineStore, set Operation to
checkStockResponse, and click the Automatically Create Variable icon to
create Local Variable with the default name provided. Use the following image as a
guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
20) Verify that your Flow_checkstock is configured with activities and partner links
shown in the following image:
Configure the Switch to Select the Store that Fulfills the Order
In this section you configure two <case> branches to check if the responses from each
store are in-stock. The left-to-right visual order of the <case> branches are important,
where the <case> branch for the InternalStore should appear as the left-most <case>
branch (in the source code it appears as the first <case> branch). This ensures that the
InternalStore is selected to provide the products for an order if it returns an in-stock
response. Next the <case> branch for the in-stock condition is evaluated for the
OnlineStore, which is only selected as the supplier of products if the InternalStore returns
an out-of-stock response. Finally, the <otherwise> branch is configured for the
situation where both the InternalStore and OnlineStore return an out-of-stock
response and the order has to be placed in a waiting state until the product quantities in
each store are updated.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
23) Configure the left-most Switch Case settings to check the response in the
Receive_internalstore_checkStockResponse_InputVariable by performing the
following steps:
a) Double-click the <case> title section on the left-most <case> branch.
b) In the Switch Case settings window, set Name to internalstore=instock and build an Expression that compares the status element in the
Receive_internalstore_checkStockResponse_InputVariable with the string 'instock'. Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
24) Configure the second Switch Case settings to check the response in the
Receive_onlinestore_checkStockResponse_InputVariable by performing the
following steps:
a) Double-click the <case> title section on the middle <case> branch.
In this section you create and name all the activities that are executed in the two <case>
branches and the <otherwise> branch of the Switch_selectstore activity.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
26) In the Fulfillment.bpel Design window, create the named activities in the
branches and sequence shown in the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
iii) Drag a Receive activity into the middle <case> branch after the
Invoke_acquireonline activity and rename it to
Receive_acquireonline.
c) For the <otherwise> branch, drag an Assign activity into branch and rename the
activity to Assign_waiting.
27) Save the changes to the Fulfillment BPEL Process.
29) To configure the Assign_acquireinternal, create two copy operations using the
following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the first copy operation, assign the StoreRequest element from the
Invoke_internalstore_checkStock_InputVariable to the StoreRequest element in
the Invoke_acquireinternal_acquireStock_InputVariable.
Note: The Invoke_internalstore_checkStock_InputVariable was already
populated by the Transform_internalstore activity.
b) In the second copy operation, assign the literal string 'completed' to the
shipStatus in the outputVariable. Use the image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section, you configure the Invoke_acquireonline to use the acquireStock operation
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
33) To configure the Assign_acquireonline, create two copy operations using the
following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the first copy operation, assign the StoreRequest element from the
Invoke_onlinestore_checkStock_InputVariable to the StoreRequest element in the
Invoke_acquireonline_acquireStock_InputVariable.
Note: The Invoke_onlinestore_checkStock_InputVariable was already populated
by the Transform_onlinestore activity.
b) In the second copy operation, assign the literal string 'completed' to the shipStatus
in the outputVariable. Use the image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section, you configure the Assign_waiting activity in the <otherwise> branch to
update the shipStatus in the outputVariable to indicate the order is not shipped because
neither store has items in stock.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
36) To configure the Assign_waiting, create a copy operation that stores the literal value
'waiting' in the shipStatus element of the outputVariable. Use the image as a
guide:
37) In the Fulfillment BPEL Process Design window verify that the Switch_selectstore
activity resembles the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Important Note: In above image of the Switch_selectstore activity flow, ensure that the
left-most <case> branch is titled <case internalstore=in-stock>, otherwise the process
will not work as documented to acquire stock from the internal store first when both the
internal and online store have items in stock.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f) In the Fulfillment.bpel Source window, select the entire second (bottommost) collapsed <case condition="bpw </sequence></case> line, and drag it
before the first <case condition="bpw </sequence></case> line (just after
the <switch name="Switch_selectstore"> element):
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section, you create one more Switch activity that checks the shipStatus in the
outputVariable. In the <case> branch check if the shipStatus is completed and execute
the Scope_shiporder activity.
39) In the Fulfillment.bpel Diagram window, collapse the Scope_checkstock and
Scope_shiporder activities.
40) In the Fulfillment.bpel Diagram window, drag a Switch activity between the
Scope_checkstock and Scope_shiporder activities. Rename the Switch to
Switch_orderstatus.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) Double-click the <case> branch title to open the Switch Case settings window, set
Name to order completed? and create an expression that compares the
shipStatus element of the outputVariable to the string literal value
'completed'. Use the following image as a guide:
c) Drag the Scope_shiporder into the <case order completed?> branch. Use the
following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
42) Collapse all the scope activities in the Fulfillment.bpel Design window, and
verify that the Fulfillment BPEL Process flow resembles the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice/task, you deploy the updated POProcessing composite application with all
the changes made to the Fulfillment BPEL process. You perform the following tests:
Submit an order that is fulfilled by the internal store.
Submit an order that is fulfilled by the online store.
Submit an order that cannot be fulfilled by any store.
You initiate and monitor the results of these tests in Oracle Enterprise Manager.
1) In the JDeveloper Application Navigator, ensure that the POApplication and its
projects are displayed.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) Do not close the ipod_query.sql window, because you reuse the query on
this page in subsequent practice steps.
7) On the POProcessing [1.0] Test Web Service page, under the Request tab Input
Arguments section, select the XML View and perform the following steps:
a) Replace the XML data with the contents of the file
D:\labs\files\xml_in\po-medium-ipod.xml.
b) Observe that the order has a quantity of 10 for products with the ID of SKU303
and SKU304. Then click Test Web Service.
c) On the Response tab, click the Launch Message Flow Trace link.
8) On the Flow Trace page, examine the Trace tree and answer the following questions:
a) What is one indicator that can be used to quickly tell if the order was fulfilled?
b) Which store was selected to fulfill the order? Explain your answer.
Answers for Step 8.
a. A quick indication that the order was fulfilled is to locate a row with a JMS Adapter
component being executed. This indicates that the order was shipped, and therefore
it must have been fulfilled by one of the stores. For example:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In the Web browser window that is opened you can view the response message:
b. The result return is in-stock. The result returned from the InternalStore is
determined by clicking the Receive_internalstore activity icon. In the Activity
Details window, click the View xml document link:
In the Web browser window that is opened you can view the response message:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
10) In the JDeveloper window, display the updated stock quantity levels for the internal
and online stores by performing the following steps:
a) In the ipod_query.sql window, click the Execute Statement icon (
verify that you obtain the following results in the Results tab:
), and
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this test you submit the po-medium-ipod.xml a second time with different
quantity values and verify that the order is fulfilled by the OnlineStore, and verify that the
stock quantity levels for the products order has been decreased.
11) On the POProcessing [1.0] Test Web Service page, click the Request tab.
Note: The Input Arguments section should contain the XML data submitted in the
previous test. If not then select the XML View and replace the XML data with the
contents of the file D:\labs\files\xml_in\po-medium-ipod.xml.
a) First update the <quantity> element values for both products to a value of 5. Use
the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c) On the Flow tab, scroll down and click the Receive_internalstore activity. In the
Activity Details window click the View xml document link.
d) On the Web page that is opened the response from the internal store is out-ofstock for example:
e) On the Flow tab, scroll down and click the Receive_onlinestore activity. In the
Activity Details window click the click the View xml document link.
f) On the Web page that is opened the response from the online store is in-stock
for example:
13) On the JDeveloper ipod_query.sql tabbed page, click the Execute Statement
icon and confirm that the ONLINE column has reduced the product quantities by a
value of 5 for the two products SKU303 and SKU304 from 8 and 7 to the values 3
and 2, respectively. Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) In the XML View of the Input Arguments section, replace existing data with text
in the D:\labs\files\xml_in\po-large-ipod.xml file, and click Test
Web Service.
b) On the Response tab, click the Launch Message Flow Trace link.
17) On the Flow Trace page, and while viewing the Trace tree, how do you know that the
order was not fulfilled by either of the stores? Use this image as a guide:
Answer: If you examine the rows under the Fulfillment BPEL Component you can
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d. No. The quantities for the product with the ID of SKU305 have not been changed.
Note: The po-large-ipod.xml order requested a quantity of 20 for the product
with ID of SKU305. Neither store has enough quantity to fulfill the order.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
), and select
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The goal of this practice is to create and handle a business fault condition in the
CreditCardValidation and the POProcessing composite applications.
You modify the CreditCardValidation composite application implementation to include a
BPEL process that obtains the credit card status from the database and performs a credit
limit check on valid cards. The following image shows the changes to the
CreditCardValidation composite application assembly model:
Note: If the order total exceeds the credit limit you throw a BPEL fault, which is
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Finally, you modify the ApproveCCOrder BPEL process to handle the fault propagated
for the credit limit error, as shown in the following image:
The ApproveCCOrder BPEL process handles the fault and sets the order status in the
outputVariable response message to indicate the order is rejected.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
propagated to the Mediator component, and then to the composite application client,
which is the ApproveCCOrder BPEL process in the POProcessing composite application.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Answers to step 3.
a. The name of the fault is validateCCfault. The following image reveals the name
property in the Property Inspector after you click the fault component in WSDL
operation:
Note: To ensure the Property Inspector is visible, select View > Property Inspector.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Answers to step 3.
b. The fault message name is called faultMessage, which is defined in a
<message> element in the Source tab of the WSDL Editor.
However, the name of the fault message can be found in two places on the Design
tab. The first place, is the in the message property in the Property Inspector, as
shown in the image for answer a. The second location where you can find the
message name is by expanding the Messages section in the WSDL editor by clicking
the Messages (Show contents) icon:
With the Messages section expanded and the fault selected in the Port Types section,
the message name and its definition is visible in the Messages section:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Answers to step 3.
d. You can find the definition of the fault message type name in the imported
creditcheck.xsd XML Schema file. To determine the leaf child element name
of the CreditCheckFault XML schema type, click Imports > creditcheck.xsd:
Note: Clicking the Imports > creditcheck.xsd opens the XSD file in the XML
Schema Editor, where you can expand the CreditCheckFault element and view its
definition and child leaf node, which is named error:
In this section you create a new BPEL component in the assembly model and use the
ValidateCreditCard.wsdl for the BPEL component interface.
Note: You use ValidateCreditCard.wsdl file for the interface to make the BPEL
interface compatible with the ValidateCreditCard Mediator component and for the
WSDL fault definition that is used in the BPEL process flow implementation.
5) In the composite.xml file with the CreditCardValidation assembly model, create
a new BPEL Process component called CheckCCLimit and use the Base on a
WSDL template. Ensure the BPEL Process component is not exposed as a SOAP
service. Use instructions in the following table and associated screenshots:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
c.
Choices or Values
Name: CheckCCLimit
Template: Base on a WSDL
Deselect the Expose as a SOAP service
option.
WSDL URL: Click the Find Existing
WSDLs icon ( ).
Accept the default File System project
location for the WSDL, select
ValidateCreditCard.wsdl and click
OK.
Verify the following additional fields are set:
WSDL URL:
ValidateCreditCard.wsdl
Port Type: validateCC_ptt
Click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c)
6) In the composite.xml window, verify that the BPEL Component has been added
to the assembly model without wires.
7) Save the changes to the composite.xml.
In this section you create the new wires in the assembly model to send validation requests
from the Mediator component to the BPEL Component in addition to the
CreditCardDBService, and from the BPEL Component to the CreditCardDBService.
Note: In this practice in the next section of this practice titled Configure the Mediator
Filters and Transformations you add the filters and transformations needed to send credit
cards to the appropriate target for processing.
8) In the composite.xml window, create the following two wires:
a) Create a new wire between the ValidateCreditCard Mediator component and the
CheckCCLimit BPEL component.
b) Create a new wire between the CheckCCLimit BPEL component and the
CreditCardDBService external reference.
9) In the composite.xml window, verify that your final CreditCardValidation
assembly model resembles the following image:
In this section you add the filters and transformations needed to send credit cards to the
appropriate target for processing. The filters ensure that credit cards beginning with the
string 9000 are sent to the CreditCardDBService, and all other cards numbers are sent
through the CheckCCLimit BPEL process first.
11) In the composite.xml window, double-click the ValidateCreditCard Mediator
component icon to open it in the Mediator Editor window.
12) In the ValidateCreditCard.mplan window, to create the filter expression for
the first routing rule section whose target is
CreditCardDBService::CreditCardDBServiceSelect perform the following steps:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: Enter the expression on one line. Use the following image as a guide:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section you create the main activities that form the BPEL process flow.
2) In the CheckCCLimit.bpel Design window, create the activity types and names
in the order listed in the following table (between the receiveInput and replyOutput
activities):
Activity Type
a. Assign
Activity Name
Assign_ccinfo
b. Invoke
c. Assign
Invoke_ccservice
Assign_ccstatus
d. Switch
Switch_cclimit
Purpose
Copies the credit card number to
CreditCardDBService request
variable.
Invokes the CreditCardDBService
Copies the credit card status value
from the CreditCardDBService
response variable.
Checks if the card status is VALID
and if the order total exceeds the
credit card limit returned with the
CreditCardDBService response.
Note: These activities form the main process flow. In subsequent steps you configure
the settings for each of the activities, and then add activities to throw the exception
and propagate the exception message to the invoker of this BPEL process.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: Your initial BPEL activity flow should resemble the following image:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
6) To configure the Assign_ccinfo activity, double-click the icon and create a single
copy operation that copies the CCNumber element from the inputVariable to the
ccNum element in the Invoke_ccservice_CreditCardDBServiceSelect_InputVariable.
Use the following image as a guide:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this section, you expand the Switch and delete the <otherwise> branch. You create the
condition in the <case> branch, and add and configure a Throw activity inside the <case>
branch.
10) In the CheckCCLimit.bpel Design window, expand the Switch_cclimit activity
and delete the <otherwise> branch. Use the following image as a guide to the result:
11) To configure the <case> branch condition, perform the following steps:
a) Double-click the <case> branch title section.
b) In the Switch Case settings window, set Name to check status and
limit.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c) In the Switch Case Expression create a conditional expression (by using the
Expression Builder) that compares the outputVariable status element to the casesensitive string literal 'VALID' and if the (order) amount in the inputVariable is
greater than the creditLimit element in the
Invoke_ccservice_CreditCardDBServiceSelect_OutputVariable.
Important Note: Ensure that you enclose the values comparing the amount and
creditLimit in the number() function to force the comparison to be based on the
numeric value, otherwise the XML expression is compared based on the string
values. Use the following image as a guide:
Note: The condition should resemble the following expression, showing where
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'))
Having detected the credit limit business fault, you throw a fault to terminate additional
processing in this BPEL process.
12) To create and configure a Throw activity inside the <case> branch of the
Switch_cclimit activity by performing the following steps:
Oracle SOA Suite 11g: Build Composite Applications 346
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a) Drag a Throw activity from the Component Palette into the <case> branch.
b) Rename the Throw activity to Throw_validateccfault
To edit the settings double-click the Throw_validateccfault icon and use instructions
in the following table and associated screenshots:
Step Screen/Page Description
a.
Throw > General tab
b.
Fault Chooser
c.
Choices or Values
To set the fault Namespace URI and Local
Part in the Faults QName section, click the
Browse Faults icon ( ).
Expand the Project WSDL Files >
ValidateCreditCard.wsdl entry,
select validateCCfault and click OK.
Observe that the Namespace URI and Local
Part fields are filled in by your selection.
Fault Variable: Click the Auto Create Fault
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Create Variable
Choices or Values
Variable icon.
Name: creditFault
Accept default values for others fields.
Click OK.
a)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b)
c)
d)
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
15) In the CheckCCLimit.bpel Design window, create a Catch branch on the main
scope by clicking the Add Catch Branch icon ( ) on the scope sidebar. Use the
following image as a guide:
16) To configure the Catch branch to handle the validateCCfault, double-click the Catch
branch icon use the following image as a guide to the settings:
).
).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
18) In the CheckCCLimit.bpel Design window, expand the Catch and add the
following activities into the catch sequence:
Step Activity Type
a.
Assign
Activity Name
Assign_ccerror
b.
Reply_ccerror
Reply
Purpose
Assigns an error message
about exceeding the credit
limit to the fault variable.
Propagates the fault and fault
message in the fault variable to
the invoker.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
19) To configure the Assign_ccerror activity, double-click the Assign_ccerror icon and
create a copy operation that stores the result of an expression, which concatenates the
text ' Error: order total exceeds the credit limit of ' with
the creditLimit element in the
Invoke_ccservice_CreditCardDBServiceSelect_OutputVariable. Use the following
image as a guide:
Note: The From value should resemble the following expression (noting the space
at the end of the first string literal parameter in the concat function):
concat('Error: order total exceeds the credit limit of ',
bpws:getVariableData('Invoke_ccservice_CreditCardDBServiceSele
ct_OutputVariable','CreditcardsCollection',
'/ns4:CreditcardsCollection/ns4:Creditcards/ns4:creditLimit'))
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
20) To configure the Reply_ccerror, double-click the Reply_ccerror icon and use the
following image as a guide to the settings:
Note: if you require help to create the Reply activity settings, perform the following
steps:
a) In the Reply window, for Partner Link click the Browse Partner Links icon (
).
b) In the Partner Link Chooser window select checkcclimit_client and click OK.
c) In the Reply window, for Variable click the Browser Variable 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you modify the ApproveCCOrder to handle the exception that can be
returned when invoking the CreditCardValidation composite application as a service. If
you do not handle the exception the process ungracefully terminates when the exception
is detected. Handling the exception is done in the scope called Scope_validatecc, in
which the ValidateCCService (external reference for the CreditCardValidation composite
application) is invoked.
Note: Creating the Catch block and fault handling is similar to what you did in the
CheckCCLimit BPEL Process in Practice 10-2. In this case, you do not propagate the
exception because it is handled by storing the rejected status in the outputVariable to
track the occurrence of an exception.
To complete the task of handling the validateCCfault, perform the following steps:
1) In the JDeveloper Application Navigator, if needed expand the POProcessing project
> SOA Content tree and double-click ApproveCCOrder.bpel to open it in the
BPEL Editor.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3) To configure the Catch branch to handle the validateCCfault, double-click the Catch
branch icon use the following image as a guide to the settings:
).
b) In the Fault Chooser, expand the Partner Links > ValidateCCService > Imported
WSDL > ValidateCreditCard.wsdl entry, select validateCCfault and
click OK.
c) In the Catch window, for Fault Variable click the Auto-create Fault Variable icon
(
).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d) Confirm your results in the Results tab with the following image:
Note: The tests will use the second credit card row, credit card number 12341234-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.
Oracle SOA Suite 11g: Build Composite Applications 358
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3) On the Oracle Enterprise Manager SOA home page, expand the SOA folder in the
Farm navigator, and click the CreditCardValidation [1.0] link
4) On the CreditCardValidation [1.0] Test Web Service page, under the Request tab
Input Arguments section with Tree View mode selected, perform the following steps:
a) Enter 1234-1234-1234-1234 in the CCNumber field and 1000 in amount,
and click Test Web Service.
b) On the Response tab, the reply status value displays the value VALID. This is
expected. For example:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b) This time the Response page is not displayed. Instead the Webservice invocation
failed window is displayed. Click Close.
7) On the CreditCardValidation [1.0] home page, under the Dashboard tab you can
click the link in the Instance ID column for the faulted instance.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
8) On the Flow Trace page, examine the Trace tree shown in the image provided and
answer the questions that follow the image:
a) Why is the CheckCCLimit BPEL Component not showing a Faulted value in the
State column?
b) How can you tell that the validateCCfault business fault has been propagated
externally to the composite application?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In the Instance of CheckCCLimit Audit Trail page, scroll down and locate the Throw
activity and observe that the fault is thrown and then caught, such that the final Assign
and Reply activities are successfully executed to propagate the fault message to the
invoker of the BPEL process:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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
the Mediator performs a transformation of the fault message data received from the
BPEL process and it performs a step showing Rethrowing fault after which the fully
qualified QName for the validateCCFault is shown. This action is the indicated that the
fault has been propagated externally.
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-43214321-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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
9) On the Oracle Enterprise Manager SOA home page, expand the SOA folder in the
Farm navigator, and click the POProcessing [1.0] link.
10) To perform a test with a valid credit card and an order total within the credit limit, on
the POProcessing [1.0] Test Web Service page, under the Request tab Input
Arguments section, perform the following steps:
a) Replace the XML data with the contents of the file
D:\labs\files\xml_in\po-small-ipod.xml.
b) Replace the quantity with a value of 1 (one), and then click Test Web Service.
c) On the Response tab, click the Launch Message Flow Trace link.
d) On the Flow Trace page, examine the Trace tree verify that the processing
completed successfully and that the product has been fulfilled by the InternalStore
and shipped. Use the following Flow Trace as a guide:
Note: If you desire confirm that the response from the ValidationCCService is the
status of VALID.
e) Close the Flow Trace Web browser window.
Oracle SOA Suite 11g: Build Composite Applications 364
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
11) To perform a test with a valid credit card and an order total that exceeds the credit
limit, on the POProcessing [1.0] Test Web Service page, click the Request tab and
perform the following steps:
a) In the Input Arguments section with the XML View selected, replace the XML
data with the contents of the file D:\labs\files\xml_in\po-largeguitar.xml.
b) Replace the quantity for both products to a value of 5 (five). This causes the order
total to be 20500, which is 500 more than the credit limit of 20000 for this
credit card. Click Test Web Service.
c) On the Response tab, click the Launch Message Flow Trace link.
12) On the Flow Trace page, confirm that the validateCCfault is thrown for the credit
limit being exceeded for this order.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
13) On the Flow Trace page, examine the Trace tree and answer the following questions:
a) What is the final order status in outputVariable supplied to the callbackClient
activity in the ApproveCCOrder BPEL process? Explain your answer.
b) Was the order processed by the Fulfillment service? Explain your answer.
c) Did the fault message get received by the ApproveCCOrder BPEL process?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: The reason why the status has been set to rejected is because the
ApproveCCOrder BPEL process caught the fault condition. In the catch block the
Assign_rejected activity sets the status.
b.
The Fulfillment BPEL process was not invoked by the ApproveCCOrder BPEL Process,
because it does not appear in the Trace tree due to the Invoke_validatecc activity
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: However, that the fault message text is not saved anywhere, and can be viewed in
the Audit Trail pages for the relevant component instances.
14) Close the Flow Trace and any Activity Detail window you have opened.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED