|Oracle® Fusion Middleware Tutorial for Running and Building an Application with Oracle SOA Suite
11g Release 1 (11.1.1)
Part Number E10275-02
The WebLogic Fusion Order Demo application of the Fusion Order Demo demonstrates using Oracle SOA Suite for processing orders from a Web shopping store front. This tutorial focuses on running and building the WebLogic Fusion Order Demo application.
This chapter contains the following sections:
For an overview of Oracle SOA Suite, see Oracle Fusion Middleware Getting Started with Oracle SOA Suite.
The StoreFront module contains the following projects:
StoreFrontUI project uses JavaServer Faces (JSF) as the view technology, and relies on the Oracle ADF Model layer to interact with Oracle Application Development Framework (Oracle ADF) Business Components in the
For a detailed description of the StoreFront module and its projects, see the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.
Once a customer places an order, the WebLogic Fusion Order Demo application processes the order.
Install Oracle JDeveloper 11g Studio Edition to create the WebLogic Fusion Order Demo application. You can download Oracle JDeveloper from:
Ensure that you download and install 11g and that it is the Studio Edition, not the Java Edition. You can verify these details in Oracle JDeveloper from the Help > About menu option.
In order to create and deploy SOA composite applications and projects, you must install the Oracle SOA Suite extension. For instructions on installing this extension for Oracle JDeveloper, see the Oracle Fusion Middleware Installation Guide for Oracle JDeveloper.
Throughout this tutorial, you must view or use content from Fusion Order Demo in your Oracle JDeveloper environment. The Fusion Order Demo is contained within a ZIP file.
To access the ZIP file:
Unzip the file to a temporary directory.
This tutorial refers to this directory as
DEMO_DOWNLOAD_HOME. When you create the WebLogic Fusion Order Demo application, create the application in a working application directory, such as
C:\fod. This tutorial refers to the working application directory location as
MY_FOD_HOME. When requested, copy needed files from the
DEMO_DOWNLOAD_HOME directory to
To successfully deploy and run the Fusion Order Demo applications, you must complete an installation for Oracle SOA Suite. Installing Oracle SOA Suite requires creating schemas for Oracle SOA Suite in an Oracle database, installing Oracle WebLogic Server, installing Oracle SOA Suite, and configuring a domain in Oracle WebLogic Server to support both Oracle SOA Suite and Oracle Enterprise Manager. Specifically, the domain contains an Administration Server and a Managed Server. The Administration Server hosts Oracle Enterprise Manager Fusion Middleware Control for performing administrative tasks; the Managed Server is an instance of an Oracle WebLogic Server used to host deployed applications. For instructions on installing and configuring Oracle SOA Suite, see the Oracle Fusion Middleware Installation Guide for Oracle SOA Suite.
After successfully completing the installation process, perform the following additional configuration steps:
Enable the credentials that are included in the StoreFront module by adding a setting to the configuration file for the domain:
Locate the configuration file set for the Oracle SOA Suite domain in the following directory:
Add the following option to the
JAVA_PROPERTIES (UNIX) or the
SET JAVA_PROPERTIES (Windows) line:
If the Oracle WebLogic Server Administration Server is running, stop it:
On UNIX, as the root user, change directories to directory
/bin and enter the following command:
On Windows, from the Windows Start menu, select All Programs > Oracle WebLogic > User Projects > domain_name > Stop Admin Server.
Start the Administration Server:
On UNIX, from directory
/bin, enter the following command:
On Windows, from the Windows Start menu, select All Programs > Oracle WebLogic > User Projects > domain_name > Start Admin Server.
When prompted on UNIX, enter your Oracle WebLogic Server user name and password. The password is not visible as you type.
The Administration Server is started when the command window displays the following messages:
<Server state changed to RUNNING> <Server started in RUNNING mode>
Leave the command window open, although you may minimize it. The Administration Server is now running and ready for use.
When the Administration Server is in
RUNNING mode, start the SOA managed server, if it is not running. In a command window, enter the following command all on one line:
On UNIX, from directory
/bin, enter the following command:
./startManagedWebLogic.sh managed_server_name admin_url username password
On Windows, from directory
\bin, enter the following command:
startWebLogic.cmd managed_server_name admin_url username password
Substitute the following values:
||The name of the Managed Server. For example:
||The URL of the Oracle WebLogic Server. For example:
||The Oracle WebLogic Server administrator. For example:
||The password of the Oracle WebLogic Server administrator. For example:
If you are deploying remotely from one computer that has Oracle JDeveloper to another computer that has the Oracle SOA Suite installation with Oracle WebLogic Server, modify the
PATH environment variables on the computer with the Oracle SOA Suite installation.
Oracle JDeveloper requires changes to these variables for running the scripts that deploy the composite services. You set the
JAVA_HOME variable to include the path to the Oracle WebLogic Server JDK, and set the
PATH variable to include the path to the Oracle WebLogic Server
bin directory for
On UNIX, use the
export command. For example:
export JAVA_HOME=$MW_HOME/jdk160_11 export PATH=$PATH:MW_HOME/modules/org.apache.ant_1.7.0/bin
On Windows, perform the following steps to modify the variables:
Open Control Panel from the Windows Start menu and double-click the System icon.
In the System Properties dialog, select the Advanced tab and click Environment Variables.
In the Environment Variables dialog, locate the
JAVA_HOME system variable and ensure that it is set to the location of the Oracle WebLogic Server JDK.
If there is no
JAVA_HOME variable defined, click New and in the New System Variable dialog, enter a variable name of
JAVA_HOME and a variable value pointing to the Oracle WebLogic Server JDK, such as
C:\weblogic\jdk160_11. Click OK to set the new system variable.
Path system variable and ensure that it includes the path to the Oracle WebLogic Server
ant\bin directory. If it does not, add the path to the end of the variable value. For example:
Click OK to set the new system variable.
Click OK twice more to dismiss the Environment Variables and the System Properties dialogs.
To create a connection to the Oracle WebLogic Server configured for Oracle SOA Suite during installation.
Start Oracle JDeveloper:
(UNIX) ORACLE_HOME/jdev/bin/jdev (Windows) JDEV_ORACLE_HOME\jdeveloper\JDev\bin\jdev.exe
From the Application Menu, select New.
In the New Gallery dialog, in the Categories tree, select General, and then Connections.
Select Application Server Connection and click OK.
The Create Application Server Connection Type page displays.
MyAppServerConnection in the Connection Name field and select WebLogic 10.3 from the Connection Type list.
The Authentication page is displayed.
weblogic for the User Name and the password for that administrator in the Password field.
In the Configuration page, enter the following values:
|Weblogic Hostname (Administration Server)||Name of the DNS name or IP address of the Administration Server of the Oracle WebLogic Server|
|Port||The address of the port on which the Administration Server is listening for requests (7001 by default)|
|WLS Domain||The domain name for Oracle WebLogic Server|
The Test page displays.
Click Test Connection.
The following message should appear:
Testing JSR-88 ... success. Testing JSR-88-LOCAL ... success. Testing JNDI ... success. Testing JSR-160 DomainRuntime ... success. Testing JSR-160 Runtime ... success. Testing JSR-160 Edit ... success. Testing HTTP ... success. Testing Server MBeans Model ... success. 8 of 8 tests successful.
If the test is unsuccessful, ensure that Oracle WebLogic Server is running, and retry the test.
In the Resource Palette, under IDE Connections, expand Application Server to see the application server connection that you created.
This tutorial focuses on building the WebLogic Fusion Order Demo application for Fusion Order Demo. To begin, spend time viewing the
WebLogicFusionOrderDemo application artifacts in Oracle JDeveloper:
Start Oracle JDeveloper.
From the JDeveloper main menu, choose File > Open.
In the Open dialog, browse to
/CompositeServices and select WebLogicFusionOrderDemo.jws. Click Open.
The following figure shows the Application Navigator after you open the file for the application workspace.
Table 1-1 describes each of the projects in the
WebLogicFusionOrderDemo application workspace:
Table 1-1 Projects in the WebLogicFusionOrderDemo Application
This project contains a composite for Oracle B2B. This composite is not used in this tutorial.
This project contains the
This project contains a build script for deploying all the SOA projects. It also contains templates for seeding JMS connector information, demo topics, and demo users.
This project provides the service needed by
This project provides a task form for approving orders from the
This project processes an order submitted in the Store Front module UI. This project contains the main process for the WebLogic Fusion Order Demo application.
This project simulates the
This project contains a composite containing a BPEL process for obtaining a quote from a partner warehouse. It is referenced as a service from the composite for the
From the Application Menu, select Close to close the sample application.
Composites enable you to easily assemble multiple technology components into one SOA application. A composite groups service components and uses wires to connect components.
OrderBookingComposite is the main project of the WebLogic Fusion Order Demo application, containing a composite application for processing orders from Global Company. This composite demonstrates how services, both internal to an enterprise, and external at other sites, can be integrated using the SOA architecture paradigm to create one cohesive ordering system.
Oracle BPEL Process Manager
Oracle Human Workflow (using a human task)
Oracle Business Rules
Oracle Messaging Service
At the center of
OrderBookingComposite composite is the
OrderProcessor BPEL process. It orchestrates all the existing services in the enterprise for order fulfillment with the right warehouse, based on the business rules in the process.
Figure 1-1 shows an overview of the
OrderBookingComposite composite for the WebLogic Fusion Order Demo application, followed by a step-by-step description of the composite flow for how the application processes an order.
Figure 1-1 OrderBookingComposite Flow
When a new customer registers in Global Company's storefront UI, the Web client sends the customer's information to the internal customer service application called
StoreFrontService then stores the customer information in a database. The customer can then browse products, add them to their online shopping cart, and place the order.
When a registered customer attempts onto Global Company's storefront UI, the UI invokes the
StoreFrontService and provides authentication. A registered user builds up their shopping cart, and places an order. When the order is submitted, the following events take place:
After an order is placed, the following sequence occurs to complete the order:
Oracle ADF Business Component writes the order to a database with schema for Fusion Order Demo, and raises a
NewOrderSubmitted event using the Event Delivery Network (EDN). The data associated with this event is the order ID.
OrderPendingEvent mediator subscribes to the
NewOrderSubmitted event, the EDN layer notifies the
OrderPendingEvent mediator of the new order.
OrderPendingEvent mediator receives the order and routes the input order ID to the
OrderProcessor BPEL process.
OrderProcessor BPEL process receives the order ID from the database, using a bind entity activity to bind to the exposed Oracle ADF Business Component
Some of the information about the order used later in the process is:
Items the customer purchased
Credit card used
Shipping address chosen
The BPEL process initiates
StoreFrontService, passing it the order ID, to retrieve information about the customer.
The BPEL process then sends the purchase amount, credit card type, and credit card number to
CreditCardAuthorizationService, which verifies if the customer's credit card is valid.
If credit card is not valid, the BPEL process cancels the order.
If credit card is valid, the BPEL process sends the order to the
RequiresApprovalRule business rule to determine if the order requires approval by management.
For those orders requiring manual approval, the BPEL process invokes the
ApprovalHumanTask human task, which routes a message to a manager, who then approves or disapproves the order.
If the order is approved, the BPEL process sends the order information to the following suppliers in parallel to obtain a bid:
Internal supplier by using the
InternalWarehouseService BPEL process, also located in
External supplier by using the
PartnerSupplierMediator mediator, which in turn routes to the
ExternalPartnerSupplier BPEL process, located in another composite called
The two suppliers respond with their bids, and the BPEL process send the bids to the
EvaluatePreferredSupplierRule business rule.
EvaluatePreferredSupplierRule business rule chooses the supplier with the lower of the two bids.
The BPEL process invokes the
FulfillOrder mediator, which performs the following two operations:
Stores the order in a temporary queue and uploads it to the fulfillment system in batch mode overnight
Routes the order to USPS
Once the order is fulfilled, the BPEL process sets the order to
The BPEL process invokes the
NotificationService service, which sends the customer an E-mail notification with the purchase order information.
When the order completes, the
OrderPendingEvent mediator publishes the
OrderCompleted business for the
When an order is updated, the following occurs:
UpdateOrderStatus mediator publishes business event
OrderUpdateEvent and sends the order ID to the
OrderProcessor BPEL process.
OrderUpdateEventMediator mediator subscribes to business event
OrderUpdateEvent, sends the order ID to
StoreFrontService, and waits for the
StoreFrontService to respond with updated details about the order.