Oracle® Fusion Middleware Tutorial for Running and Building an Application with Oracle SOA Suite 11g Release 1 (11.1.1) Part Number E10275-02 |
|
|
View PDF |
This chapter describes how to create the OrderBookingComposite
composite of the WebLogic Fusion Order Demo application. This chapter assumes you have performed all the tasks in Chapter 3, "Creating the SOA Application."
This chapter contains the following sections:
Chapter 1, "Introduction to the SOA Sample Application," describes the flow of the OrderBookingComposite
composite. Figure 4-1 shows the OrderBookingComposite
composite in the SOA Composite Editor.
The left swim lane of the SOA Composite Editor contains references that send messages to external services. Table 4-1 describes the services referenced by service components within the OrderBookingComposite
composite.
Table 4-1 Exposed Services in OrderBookingComposite Composite
Exposed Services | Description |
---|---|
This service provides an entry into the |
|
This service provides an entry into the |
The designer (middle section) of the SOA Composite Editor contains service components. Table 4-2 describes the service components used in the OrderBookingComposite
composite.
Table 4-2 Service Components in OrderBookingComposite Composite
Service Component | Type | Description |
---|---|---|
Human Task |
This component enables a manager to approve or reject an order. |
|
Business Rule |
This component chooses the shipment supplier based on the lowest bid. |
|
Mediator |
This component routes order information to either the |
|
BPEL |
This component provides a delivery date (to compete with the price from |
|
Mediator |
This component subscribes to event |
|
BPEL |
This component receives the order ID information, processes the order, and orchestrates all necessary services within the enterprise to complete the order. |
|
Mediator |
This component subscribes to event |
|
Mediator |
This component initiates the |
|
Business Rule |
This business rule determines if manual approval is required. |
|
Mediator |
This component publishes business event |
The right swim lane of the SOA Composite Editor contains references that send messages to external services. Table 4-3 describes the services referenced by OrderBookingComposite
composite.
Table 4-3 References in OrderBookingComposite Composite
Service Component | Type | Description |
---|---|---|
Web Service |
This synchronous service provides the credit card type, account number, and purchase amount to the |
|
Web Service |
This synchronous service provides customer ID information to the |
|
JMS Adapter |
This adapter provides a JMS queue for storing all fulfillment orders for overnight batch processing. The JMS adapter is used to write the order information to the specified JMS queue. |
|
Web Service |
This asynchronous service provides the lowest bid for the order from |
|
Web Service |
This synchronous service provides an Oracle Messaging Service for notifying the customer of the order. |
|
File Adapter |
This adapter ships the order using USPS. |
When creating a complex composite, you can use the following approaches for building:
Top-Down: You analyze your business processes and identify activities in support of your process. When creating a composite, you define all the SOA components through the SOA Composite Editor. You create all the services first, and then build the BPEL process, referencing the created services.
Bottom-Up: You analyze existing applications and assets to identify those that can be used as services. As you create a BPEL process, you build the services on as-needed basis. This approach works well when IT must react to a change.
For the tutorial, you use the bottom-up approach, so you can learn to build the composite in discrete segments.
In this procedure, you create the OrderBookingComposite
project and the OrderProcessor
BPEL process. This procedure contains the following tasks:
To create the OrderBookingComposite
project for the WebLogic Fusion Order Demo application:
Right-click the WebLogicFusionOrderDemo application name in the Application Navigator and select New Project.
The New Gallery dialog displays.
From either the All Technologies tab or the Current Project Technologies tab, in the Categories tree, select SOA Tier.
In the Items list, select SOA Project.
Click OK.
The Create SOA Project dialog appears.
Enter the following values:
Element | Value |
---|---|
Project Name | OrderBookingComposite |
Directory | Accept the default directory location, MY_FOD_HOME \CompositeServices\OrderBookingComposite . Oracle JDeveloper creates this directory for all the contents of the OrderBookingComposite project. |
Project Technologies | SOA |
Click Next.
In the Configure SOA Settings page, from the Composite Template section, select Composite With BPEL.
Click Finish.
The Create BPEL Process dialog displays.
Now, continue with the creation of the OrderProcessor
BPEL process:
In the Create BPEL Process dialog, enter the following values:
Element | Value |
---|---|
Name | OrderProcessor |
Namespace | http://www.globalcompany.example.com/ns/OrderBookingService |
Template | Asynchronous BPEL Process |
Expose as a SOAP service | Select this check box to create a BPEL process connected to an inbound SOAP service binding component. |
In the Input field, import the complete schema located in the DEMO_DOWNLOAD_HOME
directory.
In the Input field, click the Browse Input Elements icon.
The Type Chooser dialog displays.
Click the Import Schema File icon.
The Import Schema File dialog displays.
Click the Browse Resources icon to the right of the URL field.
The SOA Resource Browser displays.
Select File System and in the Location section, search for InternalWarehouse.xsd
in DEMO_DOWNLOAD_HOME
/CompositeServices/OrderBookingComposite/xsd
and click OK.
In the Import Schema dialog, ensure the InternalWarehouse.xsd
now displays in the URL field and the Copy to Project option is selected, and then click OK.
The Localized Files dialog displays, prompting you to import the InternalWarehouse.xsd
schema file.
Deselect the Maintain original directory for imported files option and click OK to import the files.
The Type Chooser dialog displays.
Expand Project Schema Files > InternalWarehouse.xsd and select WarehouseRequest and then click OK.
In the Create BPEL Process dialog, import the elements from the InternalWarehouse.xsd
file for the output:
In the Output field, click the Browse Output Elements icon.
The Type Chooser dialog displays.
Expand Project Schema Files > InternalWarehouse.xsd and select WarehouseResponse and then click OK.
In the Create BPEL Process dialog, click OK.
The OrderProcessor
BPEL process displays in the designer. Notice, too, the OrderBookingComposite
project displays in the Application Navigator.
In Chapter 5, "Creating the First Half of the OrderProcessor BPEL Process," you create services and building blocks for placing an order.
Click the composite.xml tab to view OrderBookingComposite
. SOAP service binding component orderprocessor_client_ep
in the left swim lane provides the outside world with an entry point into the SOA composite application.
Click the WebLogicFusionOrderDemo.jws tab to view the contents of the WebLogicFusionOrderDemo
application
From the Show list, select OrderBookingComposite to view the contents of the OrderBookingComposite
application.
Select Save All from the File main menu to save your work.
To add the ADF Business Components service run-time library:
In the Application Navigator, right-click OrderBookingComposite and select Project Properties.
Select Libraries and Classpath, and from the Libraries and Classpath page, and click Add Library.
In the Add Library dialog, select BC4J Service Runtime, and then click OK.
In the Libraries and Classpath page, click OK.
The OrderProcessor
process represents the main flow in the WebLogic Fusion Order Demo application. It sends the order information to the appropriate services at the appropriate times. For example, it contacts the CreditAuthorizationService
service to check the customer's credit card, and if the credit card is acceptable, it contacts the internal and external warehouses to get price quotes for the order.
The OrderProcessor
project is a large project. This chapter begins by giving an overview of the major blocks in the project, and then it goes into detail on how to create each block.
Table 4-4 lists the major blocks in the OrderProcesso
r process:
Table 4-4 Major Blocks in the OrderProcessor Process
Block | Type | Description |
---|---|---|
|
Receive activity |
This activity receives the order ID for incoming requests. |
Scope |
This scope retrieves order information from the database. It uses a bind entity activity to point to order data in an Oracle Application Development Framework (ADF) Business Component data services provider. |
|
Scope |
This scope calls the |
|
Scope |
This scope verifies that the customer has acceptable credit using the |
|
Scope |
This scope does the following:
|
|
Scope |
This scope sends order information to two suppliers, an external partner warehouse and an internal warehouse, and the warehouses return their bids for the orders. |
|
Scope |
This scope initiates the SelectPreferredSupplier business rule for selecting a shipping supplier with the lowest bid. |
|
Scope |
This scope calls the |
|
Scope |
This scopes assigns a final status of |
|
Scope |
This scope uses the Oracle User Messaging Service to send an email to the customer who placed the order. |
|
|
Invoke activity |
This invoke activity notifies the client that it is done. |
Figure 4-2 shows the OrderProcessor
process in the BPEL Designer of the Oracle JDeveloper with the blocks minimized. Exercises in Chapter 5 and Chapter 6 expand the blocks to show their contents and describe how to create the blocks.
Figure 4-2 Minimized View of the Blocks in OrderProcessor