Oracle® BPEL Process Manager Order Booking Tutorial
10g Release 2 (10.1.2) B15813-03 |
|
![]() Previous |
![]() Next |
This chapter of the tutorial describes how to add write functionality to the file adapter to accept input data in the form of a purchase order.
This chapter contains the following topics:
This phase of the tutorial adds to the process you designed in Chapter 8, "Using the File Adapter's Read Functionality". Ensure that you have successfully completed that phase before performing this one. In this phase of the tutorial, you add write functionality to the file adapter and use the transformation logic you designed in Chapter 7, "Adding Transformation Logic". You perform the following key tasks:
Return to the POAcknowledge BPEL process and create a partner link (named FileOutInbound) that uses the file adapter to write files to a directory (in this case, an outgoing purchase order acknowledgment).
Design POAcknowledge to invoke FileOutInbound.
Deploy POAcknowledge.
Return to the OrderBooking BPEL process and create a partner link (named WritePOA) that interacts with POAcknowledge.
Design OrderBooking to invoke WritePOA.
Deploy the OrderBooking BPEL process.
Run OrderBooking from Oracle BPEL Console by completing and submitting an order form to the Rapid Distributors and Select Manufacturing services.
Copy the purchase order file to be read to a directory.
Access the Rapid Distributors URL to manually submit a supplier price.
Observe that the purchase order file is deleted and a purchase order acknowledgement file is written to the directory. Observe that the contents of the incoming purchase order file are transformed into an outgoing purchase order acknowledgement.
This section contains these tasks:
Creating a Partner Link that Uses the File Write Functionality of the File Adapter
Validating, Compiling, and Deploying the Order Booking Process
Summary: You now create a partner link that uses the file adapter in the outbound direction. You configure the file adapter to write a file to a specified directory. In this phase, you work from the POAcknowledge project. |
Click the POAcknowledge project in the Applications Navigator section of the designer window.
Double-click POAcknowledge.bpel.
Drag and drop a PartnerLink activity from the Component Palette section onto the right side of the designer window.
Enter FileOutbound in the Name field.
Click the third icon at the top (the Define Adapter Service icon). This starts the Adapter Configuration Wizard.
Click Next on the Welcome window.
Select File Adapter on the Adapter Type window and click Next.
Enter FileWrite in the Service Name field on the Service Name window and click Next.
Select Write File as the Operation Type on the Operation window and click Next. Note that the Operation Name field is automatically filled in with Write.
Select Directory Specified as Physical Path.
Click Browse next to the Directory for Outgoing Files (physical path) field.
Select the directory in which to create files (drive_letter
:\temp
on Windows operating systems or /temp
on Unix operation systems). You must create this directory with the correct permissions if it does not exist.
Click Select.
Enter po_%yyMMddHHmmss%.xml in the File Naming Convention field.
Unselect the Number of Messages Equal, Elapsed Time Exceeds, and File Size Exceeds check boxes and click Next.
Click Browse next to the Schema File URL field on the Messages window.
Select Project Schema Files > POAcknowledge.xsd > POAcknowledge in the Type Chooser window.
Click OK.
The Schema File URL field (POAcknowledge.xsd) and the Schema Element field (POAcknowledge) are filled in.
Click Next.
Click Finish.
You are returned to the Partner Link window. All other fields are automatically completed. The window looks as follows:
Field | Value |
---|---|
Name | FileOutbound |
WSDL File | file:/c:/oraBPEL/integration/jdev/jdev/mywork/OrderBookworkspace/POAcknowledge/FileWrite.wsdl
Note: This directory path with a drive letter represents an example on Windows operating systems. If running this tutorial on Unix operating systems, your directory path varies. |
Partner Link Type | Write_plt |
My Role | Leave unspecified. |
Partner Role | Write_role |
Click OK.
Select Save from the File main menu.
Note that FileWrite.wsdl now appears under POAcknowledge > Integration Content. This file contains the parameters you specified with the Adapter Configuration Wizard.
Summary: This Invoke activity writes order acknowledgment data results into a file. |
Drag and drop an Invoke activity from the Component Palette section to below the transformPO Transform activity.
Double-click the Invoke icon to display the Invoke window.
Enter the following details:
Field | Value |
---|---|
Name | invokeFileOut |
Partner Link | FileOutbound |
The Operation (Write) field is automatically filled in.
Click the first icon to the right of the Input Variable field. This is the automatic variable creation icon.
Click OK on the Create Variable window that appears.
A variable named invokeFileOut_write_InputVariable is automatically created in the Input Variable field. This variable is automatically assigned a message type of FileWritePOAcknowledge_msg.
Select Save from the File main menu.
Drag and drop an Assign activity from the Component Palette section to above the invokeFileOut Invoke activity.
Double-click the assign icon to display the Assign window.
Click the General tab.
Enter assignFileWriteIn in the Name field.
Click Apply.
Click the Copy Rules tab.
Click Create to display the Create Copy Rule window.
Field | Value |
---|---|
From |
|
|
Variable |
|
Expand and select Variables > outputVariable > payload |
To |
|
|
Variable |
|
Expand and select Variables > invokeFileOut_Write_InputVariable > POAcknowledge |
Click OK to close the Create Copy Rule window and the Assign window.
Select Save from the File main menu.
Go to the Applications Navigator section.
Right-click POAcknowledge.
Enter the domain password of bpel when prompted.
This compiles the BPEL process. Review the bottom of the window for any errors. If there are no errors, deployment was successful. If deployment was unsuccessful, see Step 5.
Log into Oracle BPEL Console by selecting Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager 10.1.2 > BPEL Console (or refresh the page if it is already open).
The Dashboard tab of Oracle BPEL Console appears. Note that your BPEL process, POAcknowledge, now appears in the Deployed BPEL Processes list.
Click POAcknowledge.
Enter details in all fields of the HTML Form and click Post XML Message.
Refresh Oracle BPEL Console.
Click the Instances tab.
Click the POAcknowledge instance.
View the output file written in the directory you selected in Step 12 (drive_letter
:\temp
on Windows operating systems or /temp
on Unix operation systems).
Summary: You now extend the original OrderBooking process to call the newly-created POAcknowledge service to write a PO acknowledgment in a file. You perform these steps in the OrderBooking process. |
Expand the OrderBooking process in the Applications Navigator section.
Double-click OrderBooking.bpel.
Drag and drop a PartnerLink activity from the Component Palette section onto the right side of the designer window.
Enter the following values to create a partner link for the OrderBooking process:
Field | Value |
---|---|
Name | WritePOA |
WSDL File | Access this URL by clicking the WSIL Browser flashlight icon and expanding and selecting LocalBPELServer > processes > default > POAcknowledge.
http://localhost:9700/orabpel/default/POAcknowledge/POAcknowledge?wsdl See Also: "Setting the Hostname in Your JDeveloper BPEL Designer Web Browser Preferences" if you receive a parsing error when attempting to add a WSDL file in the WSDL Chooser window. |
Partner Link Type | POAcknowledge |
My Role | POAcknowledgeRequester |
Partner Role | POAcknowledgeProvider |
Click OK.
Select Save from the File main menu.
Summary: You now create a Scope activity to group all activities that form a logical step to be executed. |
Drag and drop a Scope activity from the Component Palette section to below the SelectSupplier Switch activity.
Double-click the scope icon to display the Scope window.
Enter WritePOAcknowledgment in the Name field of the General tab.
Click OK.
In this phase of the tutorial, you create the Invoke, Receive, and Assign activities inside this Scope activity.
Click the + sign to expand the Scope activity.
Select Save from the File main menu.
Summary: You now create Invoke and Receive activities. The Invoke activity provide an initiate operation that sends input data. The Receive activity provides a callback interface to receive data after the external service is processed. |
Drag and drop an Invoke activity from the Component Palette section to inside the WritePOAcknowledgment Scope activity.
Double-click the Invoke icon to display the Invoke window.
Enter the following details:
Field | Value |
---|---|
Name | invokeFileWrite |
Partner Link | WritePOA |
The Operation (initiate) field is automatically filled in.
Click the first icon to the right of the Input Variable field. This is the automatic variable creation icon.
Click OK on the Create Variable window that appears.
A variable named invokeFileWrite_initiate_InputVariable is automatically created in the Input Variable field. This variable is automatically assigned a message type of POAcknowledgeRequestMessage.
Click OK.
Drag and drop a Receive activity from the Component Palette section to below the invokeFileWrite Invoke activity inside the WritePOAcknowledgment Scope activity.
Double-click the Receive icon to display the Receive window.
Enter the following details:
Field | Value |
---|---|
Name | receiveFileWrite |
Partner Link | WritePOA |
The Operation (onResult) field is automatically filled in.
Click the first icon to the right of the Variable field. This is the automatic variable creation icon.
Click OK on the Create Variable window that appears.
A variable named receiveFileWrite_onResult_InputVariable is automatically created in the Output Variable field. This variable is automatically assigned a message type of POAcknowledgeResponseMessage.
Click OK.
Select Save from the File main menu.
Drag and drop an Assign activity from the Component Palette section to above the invokeFileWrite Invoke activity inside the WritePOAcknowledgment Scope activity.
Double-click the assign icon to display the Assign window.
Click the General tab.
Enter assignFileWriteIn in the Name field.
Click Apply.
Click the Copy Rules tab.
Click Create to display the Create Copy Rule window.
Field | Value |
---|---|
From |
|
|
Variable |
|
Expand and select Variables > inputVariable > payload |
To |
|
|
Variable |
|
Expand and select Variables > invokeFileWrite_initiate_InputVariable > payload |
Click OK to close the Create Copy Rule window and the Assign window.
Select Save from the File main menu.
Drag and drop an Assign activity from the Component Palette section to below the receiveFileWrite Receive activity inside the WritePOAcknowledgment Scope activity.
Double-click the assign icon to display the Assign window.
Click the General tab.
Enter assignFileWriteComments in the Name field.
Click Apply.
Click the Copy Rules tab.
Click Create to display the Create Copy Rule window.
Field | Value |
---|---|
From |
|
|
Expression |
|
concat(bpws:getVariableData('inputVariable','payload','/ns1:PurchaseOrder/ns1:OrderInfo/ns1:OrderComments'), ' - Write POAck complete') |
To |
|
|
Variable |
|
Expand and select Variables > inputVariable > payload > ns1:PurchaseOrder > ns1:OrderInfo > ns1:OrderComments |
Click OK to close the Create Copy Rule window and the Assign window.
When complete, the designer window looks as follows:
Click the - sign to close the WritePOAcknowledgment Scope activity.
Select Save from the File main menu.
Log into Oracle BPEL Console by selecting Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager 10.1.2 > BPEL Console (or refresh the page if it is already open).
The Dashboard tab of Oracle BPEL Console appears. Note that your BPEL processes, POAcknowledge and OrderBooking, appear in the Deployed BPEL Processes list.
Click the BPEL Processes tab.
Note which OrderBooking version has an asterisk next to the version number. This is the default version.
Click the latest version number of the OrderBooking process. If you have been incrementing the version numbers as described in previous chapters, this is the highest number.
The Managing this BPEL Process window appears.
Scroll down and click Mark as Default to make this the default version of OrderBooking.
Click Done when prompted and note that this OrderBooking version now has an asterisk next to the version number, indicating that it is the default version.
If you have installed Patch 1, go to Step 8. Otherwise, you must first perform Steps 7a through 7c. See Chapter 1, "Introduction" for information about where to obtain Patch 1.
Click Clear WSDL Cache under Related Tasks in the lower-left section.
Click Back to Processes when prompted.
Go to Step 8.
Click the Dashboard tab.
Click the OrderBooking instance version you increased in Step 5 and start it in one of the following ways:
Open the provided CreateOrderBookingUI application at http://localhost:9700/CreateOrderBookingUI
and provide inputs to initiate a process.
Enter details in all fields of the HTML Form and click Post XML Message.
Select XML Source from the Initiating a test instance list. Use a text editor to copy and paste the contents of the OrderBookingPO_1.xml
file into the field that appears. Click Post XML Message.
Copy the OrderBookingPO_1.xml
file to the directory you previously selected to invoke the process instance (drive_letter
:\temp
on Windows operating systems or /temp
on Unix operation systems). This step is optional if the BatchOrderProcessing process of section "Running and Verifying the Order Process" is complete.
Complete the manual price quote task for SelectManufacturing by using the graphical user interface JSP page, as described in Step 10.
Return to Oracle BPEL Console.
Refresh Oracle BPEL Console.
Click the Instances tab at the top.
Verify that the instances were created. All should appear in the Instance list. The Last Modified list displays the times at which they were created.
Click the instance.
Check the contents of the directory (drive_letter
:\temp
on Windows operating systems or /temp
on Unix operation systems). An output file named po_
timestamp
.xml
should be created. Verify the attributes (for example the concatenation of the first and last names, and so on).
You have now added write functionality to the file adapter to accept input data in the form of a purchase order. This input data was transformed into a purchase order acknowledgment and the results were written to a file. You performed the following key tasks:
Returned to the POAcknowledge BPEL process and created a partner link (named FileOutInbound) that used the file adapter to write files to a directory (in this case, an outgoing purchase order acknowledgment).
Designed POAcknowledge to invoke FileOutInbound.
Deployed POAcknowledge.
Returned to the OrderBooking BPEL process and created a partner link (named WritePOA) that interacted with POAcknowledge.
Designed OrderBooking to invoke WritePOA.
Deployed the OrderBooking BPEL process.
Ran OrderBooking from Oracle BPEL Console by completing and submitting an order form to the Rapid Distributors and Select Manufacturing services.
Copied the purchase order file to be read to a directory.
Accessed the Rapid Distributors URL to manually submit a supplier price.
Observed that the purchase order file was deleted and a purchase order acknowledgement file was written to the directory. Observed that the contents of the incoming purchase order file were transformed into an outgoing purchase order acknowledgement.