You are on page 1of 51

1 of 51

Creating BPEL Process to Publish, Query, and Delete Orders into Oracle E-Business Suite
Open Interface
Purpose

This OBE tutorial describes and shows how to use Oracle BPEL PM with Oracle E-Business suite. It shows how to:

1. Create a BPEL process to publish a Sales Order into Oracle E-Business Suite Open interface tables using AppsAdapter. Oracle Adapter for
Oracle Applications exposes both Open Interface Tables and Concurrent Programs as Web Services that can in turn be invoked from a BPEL
process.
2. Create a BPEL Process to query and delete the published Sales order using an Order Management stored procedure API.

This OBE leverages AppsAdapter Tutorial shipped with SOA suite

Time to Complete

Approximately 1½ hour

Topics

This OBE tutorial covers the following topics:

Overview
Scenario
Prerequisites
Part I: Deploying and running a BPEL Process to create a Sales Order into E-Business suite.
Part II: Query and Delete a Sales Order
Create a Connection to The Database
Creating a BPEL Project in JDeveloper
Define an Oracle Applications Adapter Service called "Delete Order"
Compiling and Deploying the Process
Looking up for an existing Sales Order in E-Business Suite
Running the BPEL Process from the BPEL Console
Summary

Viewing Screenshots

Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all
screenshots simultaneously, response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with
that step.

Overview

Oracle Adapters for Oracle Applications provides comprehensive bi-directional integration with Oracle Applications and supports all recommended
interfaces. , i.e., (i) interface tables; (ii) Concurrent programs; (iii) Business events; (iv) XML gateways; (v) EDI gateway; (vi) PLS/SQL APIs; (vii) Web
servies.The Adapter supports for all modules of Oracle Applications in Release 12 and Release 11.5.1 to 11.5.10, as well as supports for custom
integration interfaces with reference to various versions of Oracle E-Business Suite including Release 12, Release 11i10, and pre-Release 11i10. It
also simplifies design-time experience and promotes rapid development.

Back to Topic List

Scenario

This Sample shows how to propagate Sales Order using BPEL PM and e-Business Suite interface tables, and Concurrent program. It then deletes
the Sales Order placed from the base table using PL/SQL APIs.

Back to Topic List


2 of 51

Prerequisites

Before you perform this tutorial, you should:

1. Download and perform a basic installation of the Oracle SOA Suite (10.1.3.1) for the Windows platform. For the installation instructions, refer
to the Oracle Application Server Installation Guide.

Note: The SOA application that is used for demonstrating this tutorial is dependent on the default HTTP Port (8888) of the Oracle Application
Server.
2. Download and unzip the JDeveloper 10.1.3.2 to your local machine.
3. Download and install E-Business Suite 11.5.10

Back to Topic List

Part 1: Deploying and running a BPEL Process to create a Sales Order into E-Business suite.

1. Set up the wrapper package on target Database (The database on which you intend to run this sample) by executing the following script. For the
purpose of the lab, this step can be skipped as the wrapper package has already been created.

Open a command prompt window, navigate to the directory where you have installed the Oracle E-Business Suite files, and execute the following
command:

[ORACLE_HOME]/samples/tutorials/150.AppsAdapter/OrderImportConcurrentProgram/bpel/XX_BPEL_FND_REQUEST_SUBMIT_REQUEST.sql
as APPS/APPS.

[ORACLE_HOME] - The directory where you installed Oracle E-Business Suite


2. Start the SOA Suite instance and log into Enterprise manager.

Open any Internet browser and enter the following URL in the address bar (of the format http://<host>:<port>/em)

http://localhost:8888/em

Note: In this case, the HTTP port used is 8888 (default).

Log in to the Enterprise Manager by providing the user name as oc4jadmin and the password as welcome1 (or the one you provided at the time
of the Oracle Application Server installation)

.
3. Create a connection pool and a data source to be able to connect to the database.

a. In Oracle Enterprise Manager Application Server Control, click the Home link
3 of 51

.
b. In the home OC4J instance page, select the Administration link.

c. From the list of available administration tasks, click the Go To Task icon for the Services > JDBC Resources task.
4 of 51

d. In the Connection Pools section, click the Create button.

e. In the Create Connection Pool - Application, accept default values and click Continue. You create a new connection
pool for this tutorial.
5 of 51

f. Enter the following information in the Create Connection Pool form (leave defaults for the the fields not specified
here): Replace the DB hostname, SID/Service name, username and password as appropriate to the Database you
are trying to access to perform tasks in this tutorial.

Property Name Value


Name ebiz_pool
URL type Generate URL from Connection Information option
DB Hostname ptc-apps01.us.oracle.com
DB Listener Port 1521
SID/Service Name VIS
Username apps
Use Cleartext Password apps

After entering the above details, click the Test Connection button.
6 of 51

In the Test Connection window, click Test button to test the connection with the sample SQL statement.

Activate the Create Connection Pool window and observe the successful connection message. . If you get an error
message, check the URL and credentials to ensure you've entered the right information.

Click Finish.
7 of 51

Observe the message that the ebiz_pool connection has been created. Also, observe the ebiz_pool entry in the
Connection Pools section.

g. Now, create a Data Source.

In the JDBC Resources page, click Create button under the Data Sources section.
8 of 51

h. In the Create Data Source - Application & Type page, accept default values and click Continue. You are going to
create a Managed Data Source. This data sources uses OC4J connection pooling capability and hence the
connection pool created in the step above can be used in this case.

i. In the Create Data Source - Managed Data Source page, enter details for the data source as shown in the following
table. After entering the above details, click Finish.

Property Name Value


Name ebizDataSource
JNDI Location jdbc/ebizDataSource
Transaction Level Global & Local Transactions
Connection Pool ebiz_pool (the connection pool you created in the previous step)
Login Timeout (seconds) 0
9 of 51

Observe the confirmation that the data source ebizDataSource has been created. Also observe the entry in the Data
Sources section.

4. Create an Oracle Applications adapter connection. This connection is needed to propagate sales order information
to E-Business suite.

a. In the Oracle Application Server Control page, select the Cluster Topology breadcrumb link at the top of the
page.

.
10 of 51

b. Under the Members section > View By drop down list, select Applications to view all the applications in the OC4J
home instance.

In the expanded tree of applications, click the link of the default application.

c. Under the Modules section, click the link corresponding to the AppsAdapter resource adapter module.
11 of 51

d. On the Resource Adapter: Oracle Applications Adapter page, select the Connection Factories link.

e. Under Connection Factories, click Create. (You want to use the create button near the top of the screen, not the one
in the Shared Connection Pools section.)
12 of 51

f. In the Create Connection Factory: Select Interface page, accept default value for the Connection Factory Interface
and click Continue.

g. In the Create Connection Factory page, enter eis/Apps/appsSample as the JNDI Location. In the Configuration
Properties, enter jdbc/ebizDataSource as value for xADataSourceName. Accept default values for all other fields.
Click Finish.
13 of 51

Observe the confirmation message that the connection factory has been created.

h. Restart SOA Suite: First go to Start > All Programs > [Oracle_Home] > Stop SOA Suite.

After viewing the message, now select Start > All Programs > [Oracle_Home] > Start SOA Suite.

Back to Topic List

5. In this step, you deploy a pre-packaged BPEL process. This process reads a sales order from a pre-configured XML file
through an adapter and propagates that oder through AppsAdapter to E-Business Suite
14 of 51

a. Restart SOA Suite: Go to Start > All Programs > [Oracle_Home] > Stop SOA Suite.

After viewing the message, now select Start > All Programs > [Oracle_Home] > Start SOA Suite.

b. Access the AppsAdapter sample tutorial under [ORACLE_HOME] directory structure where you installed the SOA Suite. To
achieve this task, navigate to [ORACLE_HOME]
\bpel\samples\tutorials\150.AppsAdapter\OrderImportConcurrentProgram\bpel folder.

Right click on the bpel.xml file and select Edit to edit this xml file.

c. Edit bpel.xml to specify the physical directory for the File Adapter - synchronous read operation. Ensure that the code segment
related tot he getOrderDetails entry has the LogicalDirectory entry set to the folder path where your AppsAdapter samples are
installed, as shown below. (this path may be different for you depending on the directory where you installed your SOA suite.
For example, replace c:\SOASuite10131 with the folder where you installed your SOA suite.)

<partnerLinkBinding name="getOrderDetails">
<property name="wsdlLocation">getOrderDetails.wsdl</property>
<property name="inputDir" type="LogicalDirectory">
c:/SOASuite10131/bpel/samples/tutorials /150.AppsAdapter/OrderImportConcurrentProgram/inputDir
</property>
<property name="retryInterval">60</property>
</partnerLinkBinding>
d. After making changes to the bpel.xml file as necessary, you need to compile and deploy the BPEL process. To perform this
task, go to start > All Programs > Oracle_SOA > Oracle BPEL Process Manager > Developer Prompt.

This opens up a command prompt window. In the command prompt window.


e. In the command prompt window, change directory to the folder where the build.xml of the OrderImportDemo project is
present. The following screenshot shows a possible path to the directory.
15 of 51

Then run the obant command to compile and deploy the BPEL process. Observe the message that the Build is successful.
(Note that the following screenshot shows only partial message that you see during the compile/deploy process)

f. Edit the order_data.xml file. Open this file from the directory structure [BPEL_samples]
\150.AppsAdapter\OrderImportConcurrentProgram\inputDir folder.

Right click on the order_data.xml file and select Edit.


16 of 51

Find and replace all the three occurrences of "order_id_01" with a non-default value. For example: 123456. (Note: You need to
do this because there might already be an order with that particular orderid within E-Business Suite.) Save the file

g. Go to BPEL Console and initiate the process by supplying a dummy string as input. In a browser window, provide the URL of
the format http://<host>:<port>/BPELConsole (The default port is 8888)
for starting the BPEL Console. If you receive an error that the page cannot be opened, go to Start > All Programs >
Oracle_SOA > Oracle BPEL Process Manager > BPEL Control to start the console page.

The default login userid=bpeladmin passwd=welcome1

Select the OrderImportDemo link from the Deployed BPEL Processes list under the Dashboard or the BPEL Processes tab.
17 of 51

h. In the Initiate section, provide dummy as the value to initiate a test instance and click the Post XML Message button.

Observe the message that the Test instance is initiated and that the instance is being processed asynchronously. Click to view
the Visual Flow diagram.
18 of 51

i. The resulting visual flow diagram shows the successful invocation of the Open Interface and Concurrent Program services.
19 of 51

You can go to Audit tab and click View Raw XML link to view the XML file that is generated for the specific instance.
20 of 51

A snippet of the resulting XML file is shown below. Observe the order ID value 123456 that you provided in a previous step.

6. Navigate to Oracle Applications Forms to check the status of the Concurrent Program execution.
21 of 51

7. You can verify whether the purchase order has successfully been created, by using Oracle Applications Forms. To perform this task,
follow the instructions given below:

a. Open any Internet browser and enter the URL where your Oracle Applications is installed. The URL will be in the form of
http://<hostname where Oracle Applications is installed>:<port>. Default port number to be used is 8000.

Click the Apps Logon Links link to login to Oracle E-Business Suite. Provide appropriate username and password to login to the page.

Click the E-Business Home Page link.

Login using username and password as appropriate to your E-Business suite installation.
b. Scroll down the list of responsibilities available in the Navigator section, and click the responsibility Order Management Super User,
Vision Operations (USA). Then select Sales Order from the resulting pane (as shown in the highlighted selection of the second frame
of the screenshot). Note: Your screen may show more values than shown in the following screenshot where some portions of the
screen are stripped out.
22 of 51

c. The above step opens up one Oracle Applications 11i browser window that shows a message asking you not to close the window and
a Oracle Applications - Vision window that contains the Order Management Super User, Vision Operations (USA) Navigator form
and the Sales Orders - [New] form.

Observe that the Order Returns-->Sales Order form is active now.


23 of 51
24 of 51

d. In the Sales Order form press F11 to enable search for any Order. In the Customer PO field enter value order_id_01 (order id present
in the orders xml file) and press CTRL+F11 keys.

Details of newly created order with Order id = 'order_id_01' could be seen.

e. Press on the Line items tab. Verify the quantity and item type of the order is same as that present in the raw xml data that was
generated while the BPEL process was tested with an initiator in step 5i above.
25 of 51

Part II: Query and Delete a Sales Order

In this section, you query and delete a sales order through the DeleteOrder BPEL process. You use JDeveloper to connect to Oracle E-Business
Suite and perform this task. This BPEL process has the following activities:

 Receive activity that gets triggered by an input (order header_id) from the BPEL Console
 An assign activity that sets the header_id to the input of the DeleteOrder Stored Procedure service
 An invoke activity to call the DeleteOrder Stored Procedure service.

Create a Connection to The Database

1. If you haven't already done so, start the BPEL server process.

Restart SOA Suite: Go to Start > All Programs > [Oracle_Home] > Stop SOA Suite. After
viewing the message, now select Start > All Programs > [Oracle_Home] > Start SOA
Suite.
2. Launch Jdeveloper and create a connection to E-Business Suite using the apps schema.

a. In JDeveloper select the Connections tab (choose View > Connection Navigator if it's not displayed). Right click on
Database and select New Database Connection to open the database wizard.
26 of 51

b. Enter appropriate values to connect to your database. This tutorial uses Connection name as ebiz and username
and password as apps. The following screenshots show the Database connection creation process.

.
27 of 51

If you received an error when you test the connection, verify your database hostname, port, and SID to make sure
they are accurate. When the connection is successfully created, you view an entry for ebiz in the Database
connection navigator as shown in the following screenshot.

Back to Topic List


28 of 51

Creating a BPEL Project in JDeveloper

The first configuration task is to create a new BPEL project. To perform this task, execute the following steps:

1. Open Oracle JDeveloper BPEL Designer. Activate the Applications Navigator tab. Right click on the Applications
node and select New Applications. .

Provide name of the application as BPEL_eBuz. Click OK.

Do not create the Project file yet. Click Cancel.


29 of 51

2. Now, create a BPEL Process project. To achieve this task, perform the following steps:

Right click on BPEL_eBuz node in the Application Navigator and select New.

In the New Gallery dialog box select Projects from the General Categories section and select BPEL Process
Project from the Items section. Click OK.
30 of 51

3. The BPEL Process Project dialog box is displayed.


In the BPEL Process Name field, enter a descriptive name. For example, OrderImportDemo.

a. Select Asynchronous BPEL Process as the template and click Finish.


31 of 51

b. Observe that a BPEL Process project by name OrderImportDemo has been created in the Applications section and
view the OrderImportDemo.bpel visual process flow diagram.

Back to Topic List

Define an Oracle Applications Adapter Service called "Delete Order"

This "Delete Order" AppsAdapter service will be used to delete a sales order from E-Business Suite.

1. From Component Palette, select Services from the drop down list.

Click and drag a PartnerLink onto the Services area in the OrderImportDemo.bpel visual process flow diagram.
32 of 51

2. In the Create Partner LInk window click the Define adapter services icon in the WSDL Settings section.

3. In the Adapter Configuration Wizard, click Next for the Welcome screen. Select Oracle Applications as the
Adapter you would like to configure. Click Next.
33 of 51

4. In step 2, name the service as DeleteOrder and provide description as Deletes an existing order from E-
Business suite and click Next.

5. In Step 3, select the database connection for your applications that you created earlier in this tutorial and click Next.
34 of 51

6. In the Oracle Applications Module Browser window, navigate to the Delete Order entry through this path:
Product Families > Order Management Suite (OM_PF) > Order Management (ONT) > Sales Order
(ONT_SALES_ORDER) > PLSQL > Process Order API (OE_ORDER_PUB) > DELETE ORDER
(DELETE_ORDER)

Click OK.
35 of 51

7. In the Adapter Configuration Wizard step 4, select DELETE ORDER API and click Next.
36 of 51

With this step, you finished defining Oracle Application Adapter Service called DeleteOrder. Click Finish to
complete the process.
8. You are now returned to the Create Partner Link window, populated with WSDL Settings information based on the
adapter you created in the previous steps. Click OK.

Now return to the BPEL Designer and observe that DeleteOrder is now available as a service.
37 of 51

Save all your work by .


9. From the Component Palette, select Process Activities from the drop down list and then select the Invoke
activity.

Drag the Invoke activity to the OrderImportDemo.bpel visual process flow diagram beneath the receiveInput activity.
38 of 51

10. Drag the Invoke activity's connector to the Oracle E-Business Suite DeleteOrder partnerlink. (Hold the right arrow
button and drag it to the DeleteOrder icon)

In the Edit Invoke dialogue box, enter CallDeleteOrder as the name of the activity. Click the Automatically Create
Input Variables button to select the input variable and similarly for the output variable.
39 of 51

Observe that the Input Variable and Output Variable fields are populated. Click OK.
11. Drag and drop an Assign Activity from the Component Palette and drop in the flow before the CallDeleteOrder
activity.
40 of 51

12. Double click on the Assign_1 activity to set the values as follows for setting the input value for the CallDeleteOrder
invoke activity. On the General tab, provide name as AssignDeleteOrder. On the Copy Operation tab, select the
Copy operation from the Create option drop down list.

13. In the Create Copy Operation window:


41 of 51

in the From section expand the Variables node - Variables > Process > Variables > inputVariable > payload >
client:OrderImportDemoProcessRequest > client:input

In the To sections expand the Variables node - Variables > Process > Variables >
CallDeleteOrder_DeleteOrder_InputVariable > InputParameters > ns2:InputParameters >ns2:P_HEADER_ID

Click OK.

Click OK.

Back to Topic List

Compiling and Deploying the Process

Now compile the BPEL Process and deploy it in your local server. To complete this task, perform the following steps:

1. In the Application Navigator, expand the BPEL_eBuz application and right click on the OrderImportDemo node.
Select Make to compile the application.
42 of 51

Right click on the OrderImportDemo node and select Deploy > BPEL Process Deployer... from the menu to
deploy the application.

2. In the BPEL Process Deployer window > Integration Server Connection, click New to create a new Integration
Server connection.
43 of 51

In Step 1, provide Connection Name as SOA. Click Next.

In step 2, click the Configure a new application server icon to create a new application server connection.

In the Create Application Server Connection wizard window, provide Connection Name as
ApplicationServerConnection and select Oracle Application Server 10g 10.1.3. as Connection Type. Click Next.
44 of 51

Provide username and password that is appropriate for your SOA Suite installation. Click Next.

Ensure that the hostname and port are accurate and click Next.

Test the Connection and click Finish. Ensure that the status is Success. Otherwise, verify your connection details
and test the connection again.

With this step, you completed creating an application server instance connection.

Now, control returns to Step 2 of the Create Integration Server Connection window. Click Next.

In Step 3, Click Test Connection to ensure that the connection is successful. Click Finish.
45 of 51

Now the control returns to the BPEL Process Deployer window. Click Ok.

In the Deployment Properties window, click OK. The version will be different if you tried deployment of this
application for more than one time.
46 of 51

View the Apache Ant - Log window to make sure that the deployment is successful. Save all your files in Oracle
JDeveloper.

3. Open a browser window and view the BPEL Console (http://<hostname>:8888/BPELConsole or Start > All
Programs > Oracle SOA Suite > Oracle BPEL Process Manager > BPEL Control) to verify that the process
OrderImportDemo is available as one of the deployed BPEL Processes on the BPEL server. Click OK.
47 of 51

Back to Topic List

Looking up for an existing Sales Order in E-Business Suite

Lets look for an existing Sales Order in Oracle E-Business suite.

1. Login to your Oracle Applications instance > Oracle E-Business Suite, using login name as operations/welcome.
Choose Order management Super user, vision operations (USA) responsibility, as done in a previous step.

Click on Quick Sales Orders. This will launch corresponding forms for the Sales Orders. If this is the first time
Jinitiator is running, it will first auto install on your machines. This is a one-time process that we will be seeing.

2. We query for existing Orders. Click on Cust Name and click F11. When the fields turn blue in color, enter Business
World in the Cust Name field and press CTRL - F11. The form is now populated with information corresponding to
customer Business World. Also observe there is a line item corresponding to this customer entry. If you do not see a
line item, us the up and down arrow keys on your key board to select an Order that contains at least one line item.

The above screenshot shows an order with Order ID 57686 in the system. You may find a different order.

3. Now find out the corresponding header_id for the Order selected in the step above. We require header_id because
Order Management works on internal values. Typically Order number is provided by the external systems and there
is a possibility that there can be two Sales Order with the same Order Number(coming from two different
companies).

In JDeveloper, go to Tools > SQL Worksheet. Select ebiz as the database connection from the Select Connection
window. This is the database connection you created in an earlier step in this tutorial.

In the ebiz window, enter the following SQL statement and click the Execute SQL Statement button to
execute the command.

SELECT * FROM oe_order_headers_all


WHERE order_number=57686
48 of 51

Observe that the header_id value for order number 57686 is 104550.

Back to Topic List

Running the BPEL Process from the BPEL Console

Test a BPEL process from the BPEL Console by invoking an instance of the BPEL process and using the built in test client.

1. Open a new Internet browser and enter the following URL in the address bar to log into the Oracle BPEL Console:

http://localhost:8888/BPELConsole

If not already logged in, log in to the BPEL Control by providing the user name as oc4jadmin and the password as
welcome1 (or the one you provided at the time of the Oracle SOA Suite installation).
2. Click on OrderImportDemo link and in the Initiate tab, provide the Order ID you identified in a previous step, in the input
parameter field. click Post XML Message.

View the message that the instance has been successfully processed asynchronously. Click the Visual Flow diagram to
view the visual flow of the BPEL process diagram.

3. Now, lets verify what the result from the API that actually performs action on the sales orders will be. Click the
CallDeleteOrder activity to delete the order with the order ID supplied in the test instance.
49 of 51

4. In the Activity Audit Trail window, observe the highlighted message that shows status of the delete action.

In this tutorial example, observe the message data OE_PC_DELETE_VIOLATION with message reason as Order has
been booked. This message indicates that there is a delete violation constraint defined on the order table and hence
this order cannot be deleted. Since the specified order has already been booked, it cannot be deleted and hence the
above constraint is raised.

<X_RETURN_STATUS> E <X_RETURN_STATUS>

<X_MSG_COUNT>1<X_MSG_COUNT>

<X_MSG_DATA> ONT$#0; OE_PC_DELETE_VIOLATION ....


50 of 51

Conclusion: The above is a valid error message from the Order management system. If an Order has been booked then
you can't delete it. Try to delete another order.

However, if your order with the specified order ID is not yet booked, it can be deleted from the sales order related tables
and hence you will see a message that it has been deleted. A successful deletion message would appear as shown in
the following screenshot:

<X_RETURN_STATUS> S <X_RETURN_STATUS>

<X_MSG_COUNT> 0 <X_MSG_COUNT>

<X_MSG_DATA xsi:nil= TRUE ...


51 of 51

If you got the above message that the deletion is successful, go back to Oracle Applications and search your order
number for the line item that you deleted.

This process proves the capability of the E-Business adapter to invoke a PL/SQL API as a Service inside the BPEL flow.

Back to Topic List

Summary

In this lesson, you learned how to:

Deploy and run a BPEL Process to create a Sales Order into E-Business suite.
Query and Delete a Sales Order using E-Business adapter feature of a BPEL Process

Back to Topic List

Place the cursor over this icon to hide all screenshots.

You might also like