Skip Headers
Oracle® SOA Suite Tutorial
Release 3 (10.1.3.1.0)

Part Number B28937-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

4 Creating the FulfillmentESB Project

This chapter describes how to create the FulfillmentESB project. It contains these sections:

4.1 About the FulfillmentESB Project

After an order has been approved, the SOAOrderBooking project invokes the FulfillmentESB project to determine the shipping method for the order. Currently there are two possible shipping methods: USPS and Fedex. The FulfillmentESB project sends orders under $500 to USPS, and orders $500 and over to Fedex.

Orders are sent to the USPS through a file adapter. The order information is written to a file.

For Fedex, orders are sent through a database adapter. The order information is written to a database.

The FulfillmentESB project also sends orders to a JMS adapter. For this tutorial, the order is just sent to a JMS queue. There is no consumer of the order data from the queue. This is just to show you how to send messages to a JMS adapter, if you are planning on using one.

The FulfillmentESB project is an ESB project. In JDeveloper, the completed project looks like the following:

Figure 4-1 FulfillmentESB Project

Description of Figure 4-1 follows
Description of "Figure 4-1 FulfillmentESB Project"

The FulfillmentESB project consists of:

4.2 Create a New Project for FulfillmentESB

Start by creating a new ESB project in JDeveloper:

  1. Right-click the SOADEMO application, and select New Project.

  2. In the New Gallery, in the Categories section, expand General and select Projects. In the Items section, select ESB Project.

    Figure 4-2 New Gallery: Select "ESB Project" for the FulfillmentESB Project

    Description of Figure 4-2 follows
    Description of "Figure 4-2 New Gallery: Select "ESB Project" for the FulfillmentESB Project"

    Click OK.

  3. In the Create ESB Project dialog, enter FulfillmentESB in the Project Name field. Accept the defaults for the other fields.

    Figure 4-3 Create ESB Project Dialog for FulfillmentESB Project

    Description of Figure 4-3 follows
    Description of "Figure 4-3 Create ESB Project Dialog for FulfillmentESB Project"

    Click OK.

JDeveloper displays a blank page for the FulfillmentESB.esb file. In the Application Navigator, this file is located under FulfillmentESB > Resources:

Figure 4-4 Application Navigator Showing the FulfillmentESB File

Description of Figure 4-4 follows
Description of "Figure 4-4 Application Navigator Showing the FulfillmentESB File"

4.3 Create a System Called "Fulfillment"

For an ESB project, all ESB activities belong to a system. By default, JDeveloper places the activities in a system called "DefaultSystem".

To make your ESB projects easier to maintain, you can create a new system and set the ESB activities in a project to belong to that system. During runtime, when you manage the project in the ESB Console, you can configure properties for the activities in a system.

If you do not create a system, then in the ESB Console, you will find all your activities under "DefaultSystem".

For the FulfillmentESB project, you create a system called "Fulfillment" and set all the activities in the FulfillmentESB project to belong to this system. The OrderBookingESB project, covered in Chapter 9, also has its own system.

  1. In the empty FulfillmentESB.esb page, click the Create System/Group icon, located at the top of the page.

    Figure 4-5 Create System/Group Icon at the Top of the FulfillmentESB.esb Page

    Description of Figure 4-5 follows
    Description of "Figure 4-5 Create System/Group Icon at the Top of the FulfillmentESB.esb Page"

  2. In the Create ESB System or Service Group dialog:

    • System: select this option.

    • Name: enter Fulfillment.

    • Description: leave blank or enter a brief description.

    Figure 4-6 Create ESB System or Service Group Dialog for the "Fulfillment" System

    Description of Figure 4-6 follows
    Description of "Figure 4-6 Create ESB System or Service Group Dialog for the "Fulfillment" System"

  3. Click OK. In the Application Navigator, you should see a Fulfillment.esbsys file under FulfillmentESB > Resources.

4.4 Create the "OrderFulfillment" Routing Service

The OrderFulfillment routing service routes requests to two places:

To create the OrderFulfillment routing service:

  1. Copy the following file from the soademo_101310_prod.zip file to the SOADEMO\FulfillmentESB directory:

    • OrderBookingPO.xsd

    In the zip file, this file is located in the FulfillmentESB directory.

    This file is needed by the OrderFulfillment routing service.

  2. If the Component Palette is not showing in JDeveloper, select View > Component Palette to display it.

  3. Select ESB Services from the dropdown in the Component Palette.

  4. Drag the Routing Service icon from the Component Palette and drop it anywhere on the FulfillmentESB page.

  5. In the Create Routing Service dialog:

    • Name: enter OrderFulfillment.

    • System/Group: set to Fulfillment. If it is not set to Fulfillment, click the flashlight, which displays the ESB Service Group Browser dialog. Select Fulfillment in the dialog and click OK.

      Figure 4-7 ESB Service Group Browser

      Description of Figure 4-7 follows
      Description of "Figure 4-7 ESB Service Group Browser"

    • Generate WSDL From Schemas: select this option.

    • Schema Location: click Browse, which displays the Type Chooser dialog. In the dialog, select Project Schema Files > OrderBookingPO.xsd > PurchaseOrder.

      Figure 4-8 Type Chooser Dialog for OrderFulfillment Routing Service

      Description of Figure 4-8 follows
      Description of "Figure 4-8 Type Chooser Dialog for OrderFulfillment Routing Service"

      Click OK in the Type Chooser dialog.

    • Schema Element: select PurchaseOrder.

    • Operation Name: enter execute.

    • Namespace: enter http://www.globalcompany.com/ns/Fulfillment.

    The Create Routing Service dialog should now look like this.

    Figure 4-9 Create Routing Service Dialog for the OrderFulfillment Routing Service

    Description of Figure 4-9 follows
    Description of "Figure 4-9 Create Routing Service Dialog for the OrderFulfillment Routing Service"

  6. Click OK in the Create Routing Service dialog.

In JDeveloper, you should see this routing service instance:

Figure 4-10 OrderFulfillment Routing Service in JDeveloper

Description of Figure 4-10 follows
Description of "Figure 4-10 OrderFulfillment Routing Service in JDeveloper"

JDeveloper created the following files in the FulfillmentESB directory.

4.5 Create the "Shipment" Routing Service

The Shipment routing service routes requests either to the FedexShipment database adapter or to the USPSshipment file adapter. You will define a filter rule in the Shipment routing service to route orders greater than or equal to $500 to the FedexShipment, while orders less than $500 are routed to the USPSshipment.

To create the Shipment routing service:

  1. Drag the Routing Service icon from the Component Palette and drop it anywhere on the FulfillmentESB page.

  2. In the Create Routing Service dialog:

    • Name: enter Shipment.

    • System/Group: should be set to Fulfillment. If not, click the flashlight icon to change it.

    • Generate WSDL From Schemas: select this option.

    • Schema Location: click Browse, which displays the Type Chooser dialog. In the dialog, select Project Schema Files > OrderBookingPO.xsd > PurchaseOrder.

      Figure 4-11 Type Chooser Dialog for Shipment Routing Service

      Description of Figure 4-11 follows
      Description of "Figure 4-11 Type Chooser Dialog for Shipment Routing Service"

      Click OK in the Type Chooser dialog.

    • Schema Element: select PurchaseOrder.

    • Operation Name: enter execute.

    • Namespace: enter http://www.globalcompany.com/ns/shipment.

    The Create Routing Service dialog should now look like this:

    Figure 4-12 Create Routing Service Dialog for the Shipment Routing Service

    Description of Figure 4-12 follows
    Description of "Figure 4-12 Create Routing Service Dialog for the Shipment Routing Service"

  3. Click OK in the Create Routing Service dialog.

In JDeveloper, you should see two routing services:

Figure 4-13 JDeveloper Showing the OrderFulfillment and Shipment Routing Services

Description of Figure 4-13 follows
Description of "Figure 4-13 JDeveloper Showing the OrderFulfillment and Shipment Routing Services"

JDeveloper created the following files in the FulfillmentESB directory.

4.6 Create the "USPSShipment" Adapter (File Adapter)

The "USPSShipment" service is one of the targets for the "Shipment" routing service. When the "Shipment" routing service sends an order to the "USPSShipment" service, the "USPSShipment" service writes the order information to a flat file in the C:\temp directory.

To create the "USPSShipment" service:

  1. Copy the following file from the soademo_101310_prod.zip file to the FulfillmentESB directory:

    • USPSShipment.xsd

    In the zip file, this file is located in the FulfillmentESB directory.

  2. In the Component Palette, select Adapter Services from the dropdown.

  3. Drag the File Adapter icon from the Component Palette and drop it anywhere on the FulfillmentESB page.

  4. In the Create File Adapter Service dialog:

    • Name: enter USPSShipment.

    • System/Group: should be set to Fulfillment. If not, click the flashlight icon to change it.

    • WSDL File: click the Configure Adapter Service WSDL icon (the one on the left), which launches the Adapter Configuration wizard.

      Click Next on the Welcome page of the wizard.

      Step 1, Service Name:

      Figure 4-14 Adapter Configuration Wizard, Step 1, Service Name

      Description of Figure 4-14 follows
      Description of "Figure 4-14 Adapter Configuration Wizard, Step 1, Service Name"

      • Service Name: enter USPSShipment.

      • Click Next.

      Step 2, Operation:

      Figure 4-15 Adapter Configuration Wizard, Step 2, Operation

      Description of Figure 4-15 follows
      Description of "Figure 4-15 Adapter Configuration Wizard, Step 2, Operation"

      • Operation Type: select Write File.

      • Operation Name: should be filled in with Write.

      • Click Next.

      Step 3, File Configuration:

      Figure 4-16 Adapter Configuration Wizard, Step 3, File Configuration

      Description of Figure 4-16 follows
      Description of "Figure 4-16 Adapter Configuration Wizard, Step 3, File Configuration"

      • Directory for Outgoing Files: enter the directory where you want the adapter to write the files. For example, you can enter C:\temp.


        Note:

        This directory is located on the machine where you are running Oracle Application Server, not the machine where you are running JDeveloper.

      • File Naming Convention: specify how you want to name the files. Enter shipment_%SEQ%.txt. The %SEQ% indicates that the filenames will be numbered sequentially.

      • Number of Messages Equals: You can leave it at 1, which means that each order will be written in a separate file.

      • Click Next.

      Step 4, Messages:

      Figure 4-17 Adapter Configuration Wizard, Step 4, Messages

      Description of Figure 4-17 follows
      Description of "Figure 4-17 Adapter Configuration Wizard, Step 4, Messages"

      • Native format translation is not required (Schema is Opaque): do not select this option.

      • Schema Location. Click Browse. In the Type Chooser, select Project Schema Files > USPSShipment.xsd > shipment.

        Figure 4-18 Type Chooser for USPSShipment File Adapter

        Description of Figure 4-18 follows
        Description of "Figure 4-18 Type Chooser for USPSShipment File Adapter"

        Click OK in the Type Chooser.

      • Schema Element: should be set to shipment.

      • Click Next.

      On the Finish page, click Finish.

      The wizard creates the following files in the FulfillmentESB directory:

      • USPSShipment.wsdl - this file contains the information you specified in the wizard.

      • fileAdapterOutboundHeader.wsdl - this file contains generic information for writing to files.

      The Create File Adapter Service dialog should now look like this. JDeveloper automatically filled in Write_ptt for Port Type.

      Figure 4-19 Create File Adapter Service Dialog for the USPSShipment File Adapter Service

      Description of Figure 4-19 follows
      Description of "Figure 4-19 Create File Adapter Service Dialog for the USPSShipment File Adapter Service"

  5. Click OK in the Create File Adapter Service dialog.

In JDeveloper, you should see two routing services and a file adapter service:

Figure 4-20 JDeveloper Showing the OrderFulfillment and Shipment Routing Services, and the USPSShipment File Adapter Service

Description of Figure 4-20 follows
Description of "Figure 4-20 JDeveloper Showing the OrderFulfillment and Shipment Routing Services, and the USPSShipment File Adapter Service"

4.7 Create the "FedexShipment" Adapter (Database Adapter)

The FedexShipment service is a database adapter. When the Shipment routing service routes an order to the FedexShipment adapter, the FedexShipment adapter writes the order information to the FEDEXSHIPMENT table in the SOADEMO schema.

To create the FedexShipment adapter:

  1. Copy the following file from the soademo_101310_prod.zip file to the FulfillmentESB directory:

    • FedexShipment_table.xsd

    In the zip file, this file is located in the FulfillmentESB directory.

  2. In the Component Palette, select Adapter Services from the dropdown.

  3. Drag the Database Adapter icon from the Component Palette and drop it anywhere on the FulfillmentESB page.

  4. In the Create Database Adapter Service dialog:

  5. Click OK in the Create Database Adapter Service dialog.

In JDeveloper, you should see two routing services, a file adapter service, and a database adapter service.

Figure 4-28 JDeveloper Showing the OrderFulfillment and Shipment Routing Services, the USPSShipment File Adapter Service, and the FedexShipment Database Adapter Service

Description of Figure 4-28 follows
Description of "Figure 4-28 JDeveloper Showing the OrderFulfillment and Shipment Routing Services, the USPSShipment File Adapter Service, and the FedexShipment Database Adapter Service"

4.8 Create the "FulfillmentBatch" Adapter (JMS Adapter)

The "OrderFulfillment" routing service routes all orders to the "Shipment" routing service and to the "FulfillmentBatch" adapter. The "FulfillmentBatch" adapter sends the order information to a JMS server.

To create the FulfillmentBatch JMS adapter:

  1. In the Component Palette, select Adapter Services from the dropdown.

  2. Drag the JMS Adapter icon from the Component Palette and drop it anywhere on the FulfillmentESB page.

  3. In the Create JMS Adapter Service dialog:

  4. Click OK in the Create JMS Adapter Service dialog.

In JDeveloper, you should see two routing services, a file adapter service, a database adapter service, and a JMS adapter service.

Figure 4-38 JDeveloper Showing All the Services for the FulfillmentESB Project

Description of Figure 4-38 follows
Description of "Figure 4-38 JDeveloper Showing All the Services for the FulfillmentESB Project"

4.9 Create Routing Rules

To route order information from one service to another, you set up routing rules. Routing rules enable you to define filters and transformations. Filters enable you to define conditions under which a service gets to process an order, and transformations enable you to map data so that the target service is able to process the data correctly.

For the FulfillmentESB project, you create routing rules between the following services:

4.9.1 Between OrderFulfillment and Shipment

The OrderFulfillment routing service routes orders to two places: Shipment and FulfillmentBatch.

To create routing rule between OrderFulfillment and Shipment:

  1. Double-click OrderFulfillment in the top section of the icon. This displays the page for the Fulfillment_OrderFulfillment.esbsvc file.

    Figure 4-39 Definition for the Fulfillment_OrderFulfillment Routing Service

    Description of Figure 4-39 follows
    Description of "Figure 4-39 Definition for the Fulfillment_OrderFulfillment Routing Service"

  2. In the Routing Rules section, click the [+] to expand it.

  3. Click the green + icon to add a routing route. This displays the Browse Target Service Operation dialog.

    You may have to scroll to the right to see the green + icon.

  4. In the Browse Target Service Operation dialog, select Services In Project > Fulfillment > Shipment > execute.

    Figure 4-40 Browse Target Service Operation Dialog

    Description of Figure 4-40 follows
    Description of "Figure 4-40 Browse Target Service Operation Dialog"

  5. Click OK in the Browse Target Service Operation dialog.

    The routing rule area now looks like this:

    Figure 4-41 Routing Rule from OrderFulfillment to Shipment

    Description of Figure 4-41 follows
    Description of "Figure 4-41 Routing Rule from OrderFulfillment to Shipment"

  6. Select File > Save to save your work.

For this routing rule, there are no filters and no transformations. The OrderFulfillment routing service routes all orders to the Shipment routing service. The data is not transformed in any way.

Click the FulfillmentESB.esb tab in JDeveloper. You should see an arrow going from OrderFulfillment to Shipment.

Figure 4-42 JDeveloper Showing Routing from OrderFulfillment to Shipment

Description of Figure 4-42 follows
Description of "Figure 4-42 JDeveloper Showing Routing from OrderFulfillment to Shipment"

4.9.2 Between OrderFulfillment and JMS Adapter

The OrderFulfillment routing service routes orders to two places: Shipment and FulfillmentBatch (which is a JMS adapter service).

To create routing rule from OrderFulfillment to FulfillmentBatch:

  1. Double-click OrderFulfillment in the top section of the icon. This displays the page for the Fulfillment_OrderFulfillment.esbsvc file.

  2. In the Routing Rules section, click the [+] to expand it. You should see the rule that you created in the previous section (Section 4.9.1, "Between OrderFulfillment and Shipment").

    Figure 4-43 Definition for the OrderFulfillment Routing Service

    Description of Figure 4-43 follows
    Description of "Figure 4-43 Definition for the OrderFulfillment Routing Service"

  3. Click the green + icon to add another routing route. You may have to scroll to the right to see the + icon.

  4. In the Browse Target Service Operation dialog, select Services In Project > Fulfillment > FulfillmentBatch > sendMessage.

    Figure 4-44 Browse Target Service Operation Dialog

    Description of Figure 4-44 follows
    Description of "Figure 4-44 Browse Target Service Operation Dialog"

  5. Click OK in the Browse Target Service Operation dialog.

    The routing rule area now contains two rules:

    Figure 4-45 Routing Rules for the OrderFulfillment Routing Service

    Description of Figure 4-45 follows
    Description of "Figure 4-45 Routing Rules for the OrderFulfillment Routing Service"

  6. Select File > Save to save your work.

Click the FulfillmentESB.esb tab in JDeveloper. From OrderFulfillment, there should be two arrows: one going to Shipment and one going to FulfillmentBatch.

Figure 4-46 JDeveloper Showing Routing from OrderFulfillment to Shipment and JMSAdapter

Description of Figure 4-46 follows
Description of "Figure 4-46 JDeveloper Showing Routing from OrderFulfillment to Shipment and JMSAdapter"

4.9.3 Between Shipment and USPSShipment

The Shipment routing service routes orders that are under $500 to the USPSShipment file adapter and orders that are $500 and over to the FedexShipment database adapter.

This section shows the routing rule for USPSShipment. It uses a filter to set the $500 rule, and it uses transformation to control what information is passed to USPSShipment. USPSShipment, which is a file adapter service, then writes the information to a file in the C:\temp directory.

To create the routing rule from Shipment to USPSShipment:

  1. Double-click Shipment in the top section of the icon. This displays the page for the Fulfillment_Shipment.esbsvc file.

  2. In the Routing Rules section, click the [+] to expand it.

  3. Click the green + icon to add a routing route. You may have to scroll to the right to see the + icon.

  4. In the Browse Target Service Operation dialog, select Services In Project > Fulfillment > USPSShipment > Write.

    Figure 4-47 Browse Target Service Operation Dialog

    Description of Figure 4-47 follows
    Description of "Figure 4-47 Browse Target Service Operation Dialog"

  5. Click OK in the Browse Target Service Operation dialog.

    The routing rule area now looks like this:

    Figure 4-48 Routing Rule from Shipment to USPSShipment

    Description of Figure 4-48 follows
    Description of "Figure 4-48 Routing Rule from Shipment to USPSShipment"

  6. Select File > Save to save your work.

    Click the FulfillmentESB.esb tab in JDeveloper. You should see an arrow going from Shipment to USPSShipment.

    Figure 4-49 JDeveloper Showing Routing from Shipment to USPSShipment

    Description of Figure 4-49 follows
    Description of "Figure 4-49 JDeveloper Showing Routing from Shipment to USPSShipment"

  7. Create the filter so that only orders under $500 are directed to USPSShipment.

    1. Double-click Shipment in the top section of the icon to display the page for the Fulfillment_Shipment.esbsvc file.

    2. In the page for the Fulfillment_Shipment.esbsvc file, click the filter icon in the routing rules area. This displays the Expression Builder dialog.

    3. In the Expression Builder dialog, in the WSDL Message box, select Purchase Order_request > PurchaseOrder > inp1:PurchaseOrder > inp1:OrderInfo > inp1:OrderPrice.

      The Content Preview box shows the path: /inp1:PurchaseOrder/inp1:OrderInfo/inp1:OrderPrice.

    4. Click Insert Into Expression. The path appears in the Expression box at the top of the dialog.

    5. In the Expression box, append < 500 to the path, so that it now reads /inp1:PurchaseOrder/inp1:OrderInfo/inp1:OrderPrice < 500.

      Figure 4-50 Expression Builder Dialog

      Description of Figure 4-50 follows
      Description of "Figure 4-50 Expression Builder Dialog"

    6. Click OK in the Expression Builder.

    7. Select File > Save to save your work.

  8. Create a transformation so that the USPSShipment file adapter gets the proper information in the proper fields.

    1. Click the transformation icon in the Routing Rules area.

    2. In the Request Transformation Map dialog, select Create New Mapper File and enter PurchaseOrder_To_USPSshipment.xsl as the filename.

      Figure 4-51 Request Transformation Map Dialog

      Description of Figure 4-51 follows
      Description of "Figure 4-51 Request Transformation Map Dialog"

    3. Click OK. This brings up the Data Mapper.

    4. On the source (left) side, expand inp1:ShipTo > inp1:Name and inp1:ShipTo > inp1:Address.

    5. Click and drag inp1:First to imp1:fname.

    6. Click and drag inp1:Last to imp1:lname.

      There should be two lines, one for First/fname and another one for Last/lname.

      Figure 4-53 Data Mapper Showing Transformation for First/fname and Last/lname

      Description of Figure 4-53 follows
      Description of "Figure 4-53 Data Mapper Showing Transformation for First/fname and Last/lname"

    7. Click and drag to connect these pairs:

      • inp1:Street to imp1:address

      • inp1:City to imp1:city

      • inp1:State to imp1:state

      • inp1:Zip to imp1:zipcode

      • inp1:Country to imp1:country

    8. Select Conversion Functions from the dropdown in the Component Palette. You will need the string function for the next step.

    9. For each of the pairs listed in step (g), drag the string function from the Component Palette and drop it on each of the lines. You should end up with a diagram that looks like this:

      Figure 4-54 Data Mapper Showing Use of string Function During Transformation

      Description of Figure 4-54 follows
      Description of "Figure 4-54 Data Mapper Showing Use of string Function During Transformation"

  9. Select File > Save to save your work.

  10. Click the Fulfillment_Shipment.esbsvc tab in JDeveloper. In the Routing Rules area, in the transformation section, you should see the name of the transformation file.

    Figure 4-55 Fulfillment_Shipment.esbsvc Showing Filter Information and Name of Transformation File

    Description of Figure 4-55 follows
    Description of "Figure 4-55 Fulfillment_Shipment.esbsvc Showing Filter Information and Name of Transformation File"

  11. Select File > Save to save Fulfillment_Shipment.esbsvc.

  12. If you click the FulfillmentESB.esb tab, you can see that the filter and transformation icons for the Shipment routing service are no longer greyed out, unlike those for the OrderFulfillment routing service.

4.9.4 Between Shipment and FedexShipment

The Shipment routing service routes orders that are under $500 to the USPSShipment file adapter and orders that are $500 and over to the FedexShipment database adapter.

This section shows the routing rule for FedexShipment. It uses a filter to set the $500 rule, and it uses transformation to control what information is passed to FedexShipment. FedexShipment, which is a database adapter service, then writes the information to the FEDEXSHIPMENT table in the SOADEMO schema.

To create the routing rule from Shipment to FedexShipment:

  1. Double-click Shipment or click the tab for Fulfillment_Shipment.esbsvc, if you have it open. This displays the page for the Fulfillment_Shipment.esbsvc file.

  2. In the Routing Rules section, click the [+] to expand it.

  3. Click the green + icon to add another routing route. You may have to scroll to the right to see the + icon.

  4. In the Browse Target Service Operation dialog, select Services In Project > Fulfillment > FedexShipment > insert.

    Figure 4-56 Browser Target Service Operation Dialog

    Description of Figure 4-56 follows
    Description of "Figure 4-56 Browser Target Service Operation Dialog"

  5. Click OK in the Browse Target Service Operation dialog.

    The routing rule area now looks like this:

    Figure 4-57 Routing Rule from Shipment to FedexShipment

    Description of Figure 4-57 follows
    Description of "Figure 4-57 Routing Rule from Shipment to FedexShipment"

  6. Select File > Save to save Fulfillment_Shipment.esbsvc.

    Click the FulfillmentESB.esb tab in JDeveloper. From Shipment, you should see two arrows: one going to USPSShipment and another one going to FedexShipment.

    Figure 4-58 JDeveloper Showing Routing from Shipment to USPSShipment and FedexShipment

    Description of Figure 4-58 follows
    Description of "Figure 4-58 JDeveloper Showing Routing from Shipment to USPSShipment and FedexShipment"

  7. Create the filter that directs orders that are equal to or greater than $500 to FedexShipment.

    1. Double-click Shipment to display the page for the Fulfillment_Shipment.esbsvc file.

    2. In the page for the Fulfillment_Shipment.esbsvc file, click the filter icon for the FedexShipment rule in the routing rules area. This displays the Expression Builder dialog.

    3. In the Expression Builder dialog, in the WSDL Message box, select Purchase Order_request > PurchaseOrder > inp1:PurchaseOrder > inp1:OrderInfo > inp1:OrderPrice.

      The Content Preview box shows the path: /inp1:PurchaseOrder/inp1:OrderInfo/inp1:OrderPrice.

    4. Click Insert Into Expression. The path appears in the Expression box at the top of the dialog.

    5. In the Expression box, append >= 500 to the path, so that it now reads /inp1:PurchaseOrder/inp1:OrderInfo/inp1:OrderPrice >= 500.

      Figure 4-59 Expression Builder Dialog

      Description of Figure 4-59 follows
      Description of "Figure 4-59 Expression Builder Dialog"

    6. Click OK in the Expression Builder.

    7. Select File > Save to save your work.

  8. Create a transformation so that the FedexShipment database adapter gets the proper information in the proper fields.

    1. Click the transformation icon in the Routing Rules area.

    2. In the Request Transformation Map dialog, select Create New Mapper File and enter PurchaseOrder_To_FedexshipmentCollection.xsl as the filename.

      Figure 4-60 Request Transformation Map Dialog

      Description of Figure 4-60 follows
      Description of "Figure 4-60 Request Transformation Map Dialog"

    3. Click OK. This brings up the Data Mapper.

    4. On the source (left) side, expand inp1:ShipTo > inp1:Name and inp1:ShipTo > inp1:Address.

    5. On the target (right) side, expand top:FedexshipmentCollection > top:Fedexshipment.

    6. Click and drag to connect these pairs:

      • inp1:ID to top:orderid

      • inp1:First to top:fname

      • inp1:Last to top:lname

      • inp1:Street to top:street

      • inp1:City to top:city

      • inp1:State to top:state

      • inp1:Zip to top:zipcode

      Figure 4-61 Data Mapper Showing Transformation from Shipment to FedexShipment

      Description of Figure 4-61 follows
      Description of "Figure 4-61 Data Mapper Showing Transformation from Shipment to FedexShipment"

  9. Select File > Save to save PurchaseOrder_To_FedexshipmentCollection.xsl.

  10. Click the Fulfillment_Shipment.esbsvc tab in JDeveloper. In the Routing Rules area, in the transformation section, you should see the name of the transformation file.

    Figure 4-62 Fulfillment_Shipment.esbsvc Showing Filter Information and Name of Transformation File

    Description of Figure 4-62 follows
    Description of "Figure 4-62 Fulfillment_Shipment.esbsvc Showing Filter Information and Name of Transformation File"

  11. Select File > Save to save Fulfillment_Shipment.esbsvc.

  12. If you click the FulfillmentESB.esb tab, you can see that there are two rows of icons in the Shipment routing service icon and these icons are not greyed out.

4.10 Save All Files in the FulfillmentESB Project

Browse through the FulfillmentESB files in the Application Navigator to ensure that all the files are saved. If you see a file in italics, select the file and save it.

4.11 Register the FulfillmentESB Project

In the Application Navigator, right-click the FulfillmentESB project and select Register with ESB > SoademoIntegServer, where SoademoIntegServer is the name of the connection to the integration server. When registration is complete, JDeveloper displays a confirmation dialog.

You can view the services that you created in the FulfillmentESB project in the ESB Console. To do this, enter the URL of the ESB Console in a browser:

http://host:port/esb/esb/EsbConsole.html

host specifies the name of the machine running Oracle Application Server, and port specifies the HTTP port at which Oracle HTTP Server or OC4J is listening.

Log in as the oc4jadmin user.

The services are grouped under Fulfillment, which is the name of the system that you created in Section 4.3, "Create a System Called "Fulfillment"".

Figure 4-63 ESB Console Showing the Services in the Fulfillment System

Description of Figure 4-63 follows
Description of "Figure 4-63 ESB Console Showing the Services in the Fulfillment System"