Skip Headers
Oracle® Application Server Adapters for Tuxedo User's Guide
10g Release 3 (10.1.3.4)

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

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

4 BPEL Process Manager Examples

This chapter contains the following topics:

Getting Started

This topic describes the components necessary to work with the samples and how to prepare your system.

Prerequisites

The following are installation and configuration requirements for using the examples.

This chapter provides examples of the configuration steps that are used when using BPEL to work with the Oracle Tuxedo adapters. You should be familiar with the following before working with these examples:

Integration between the OracleAS adapters for Tuxedo and BPEL has the following processes:

Deploy a BPEL Inbound Process

This section describes how to create a BPEL inbound process that connects to a Tuxedo adapter. For information on how to configure a Tuxedo adapter for inbound, see

To configure a process with the BPEL process manager, you use JDeveloper. This section describes how to create a BPEL inbound process for Tuxedo adapters using JDeveloper. There are two configuration types necessary to carry out this inbound sample.

Before you design the inbound process, make sure to integrate and connect your OracleAS adapter for Tuxedo with the BPEL process manager. See Chapter 7, "Integrating OracleAS Adapters for Tuxedowith Oracle BPEL Process Manager" for more information.

Beginning Tasks

Before you design the inbound process, you must carry out the following:

  • Integrate the OracleAS Adapter for VSAM with OC4J. See Integrating OracleAS Adapters for Tuxedo with OC4J for more information.

  • Configure the connection for the J2CA VSAM resource adapter. You do this by creating a connection factory. See Configuring the Tuxedo Queue Inbound Adapter for information on how to do this.

  • Write a schema file. First, create an interaction called findDoctor using Oracle Studio. See Configuring the Tuxedo Queue Inbound Adapter for more information.

  • Create a BPEL PM Server Connection in JDeveloper.

  • Create the WSDL for the interaction. You do this in JDeveloper Connections explorer before you begin to build your endpoint in JDeveloper. JDeveloper will create the WSDL automatically based on the interaction you create. In the Connections explorer, browse for the Oracle Connect server you configured in Oracle Studio (see Installing Oracle Connect), then double-click the findDoctor interaction to view and create the WSDL.

Design-Time Configuration

This section describes the design-time steps necessary to deploy a BPEL inbound process:

Create a BPEL Project for a BPEL Inbound Process

You use JDeveloper to create a Partner Link to the OracleAS adapter you are working with. The process is raised by the adapter, so the inbound process defines the OracleAS type. Do the following to create the BPEL project.

  1. In JDeveloper, from the View menu, select Application Navigator then Create a new application. The Create Application dialog box is displayed.

    Figure 4-1 Create Application

    This screen shows how to create a new BPEL project
    Description of "Figure 4-1 Create Application"

  2. Enter a name in the Application Name field, for example BPELAppDemo.

  3. In the Applications Navigator tab, right-click the application called that you created in step 2 and select New Project. The New Gallery dialog box is displayed.

  4. From the Items list, select BPEL Process Project then click OK. The BPEL Project Creation Wizard-Project Settings dialog box is displayed.

    Figure 4-2 Project Settings

    This screen shows the project settings
    Description of "Figure 4-2 Project Settings"

  5. Do the following in BPEL Project Creation Wizard-Project Settings dialog box:

    • Enter a name for the BPEL process, for example BPELInbound1.

    • From the Template list, select Empty BPEL Process.

  6. Click Next to review the input/output schema elements or click Finish.

Design the BPEL Inbound Process

Before you begin the design inbound process procedure, find the WSDL file you will work with from your Windows file system. Open the file in a text editor and copy the XSD schema section into a new file. Save the file as message.xsd.

For more information on working with the inbound WSDL, see Configuring Inbound WSDL.

Do the following to define the BPEL inbound process.

  1. From the Component Palette-Process Activities pane, drag a Receive, Assign, and Invoke process into the editor for the process you created in the Create a BPEL Project for a BPEL Inbound Process step.

    Figure 4-3 Edit the Process

    This image shows where you create a process
    Description of "Figure 4-3 Edit the Process"

  2. Drag a PartnerLink into a service lane of the visual editor. The Create Partner Link dialog box is displayed.

    Figure 4-4 Create Partner Link

    This image shows the Create Partner Link dialog box
    Description of "Figure 4-4 Create Partner Link"

  3. From the Create Partner Link dialog box, click the Service Explorer button. This button is the second form the left and is shown in the figure in the previous step.

    The Service Explorer dialog box is displayed.

    Figure 4-5 Service Explorer

    This image shows the Service Explorer
    Description of "Figure 4-5 Service Explorer"

  4. In the Service Explorer, expand the connection you are using, then expand adapters and then applications, and continue to browse until you find the WDSL file you are using.

    Select the file and click OK.

    The WSDL File field in the Create Partner Link dialog box displays the path to the WSDL file you selected. The Partner Link Type field displays the Partner Link defined in the WSDL file.

    Figure 4-6 WSDL Selection

    This image shows the WSDL information
    Description of "Figure 4-6 WSDL Selection"

  5. Do the following in the Create Partner Link dialog box:

    • In the Partner Role list, select Not Specified.

    • In the My Role list, select the role for the selected WSDL file.

  6. Click OK. The new Partner Link appears in the visual editor. Save the file.

  7. In the Visual Editor, connect the Receive activity to the Partner Link. The Edit Receive dialog box is displayed.

    Figure 4-7 Receive Properties

    This screen shows the Edit Receive dialog box
    Description of "Figure 4-7 Receive Properties"

  8. Do the following in the Edit Receive dialog box:

    • Enter a name for the Receive activity.

    • Make sure to crate the variable. Click the first button to the right of the Variable field, then click OK in the Crate Variable dialog box that is displayed.

    • Make sure that the Create Instance check box is selected.

  9. Click OK to close the dialog box and accept the information.

Create the Connection

This section describes how to create a connection to the adapter files you are using. Do the following to create the connection.

  1. Create a file adapter and give it a name, for example WriteRes.

  2. Click Next and select Write File. Give the file a name, for example Write Message.

  3. Click Next and enter the path to the message file you want to write to.

  4. In the Message Schema chooser, browse to the file message.xsd. You should have made sure that this file was created before you started this process. See the beginning of the section, Design the BPEL Inbound Process for more information.

  5. Select the Message type, bigOrderEvent and then click OK.

  6. Create an Input Variable with the default name for the Invoke activity.

  7. Create a Copy Operation for the Assigned activity.

Deploy the BPEL Inbound Process

Do the following to deploy the BPEL inbound process that you created.

  1. Right-click the process flow in the Applications-Navigator pane.

  2. Select Deploy, then Your BPEL PM Server Connection, then Deploy to default domain.

  3. At the prompt, enter your BPEL PM server password and click OK

    The deployment process starts automatically.

Runtime Configuration

This section describes how to test the project and run it to see that the inbound process is executed successfully. By using the XML utility, you will call an event in Oracle Connect that is defined in the file adapter you created. See Create the Connection. Because this event is called from Oracle Connect it is an inbound event. Events that originate with SOA services in the OracleAS, it is an outbound event. For more information, see Deploy a BPEL Outbound Process. The Runtime configuration for inbound has one step called Triggering the Event using the XML Utility.

Triggering the Event using the XML Utility

Use the XML utility to create an SQL statement to trigger the event you are requesting. Do the following to trigger the event.

  1. From the Start menu, select All Programs, then Oracle, then Server Utilities, and then XML Utility. The XML Utility is displayed.

    Figure 4-8 Trigger for Inbound Process

    This figure shows an XML for inbound process
    Description of "Figure 4-8 Trigger for Inbound Process"

  2. Enter the following information in the Connect section of the XML utility:

    • Server: The name of the machine where the OracleAS adapter for Tuxedo is located.

    • Workspace: The name of the workspace where the OracleAS adapter for Tuxedo is located. A list of available workspaces is shown in the list for this field. The workspaces are defined in Oracle Studio.

    • Adapter: The name of the OracleAS adapter for Tuxedo. A list of available adapters is shown in the list for this field. The adapters are defined in Oracle Studio.

  3. Click Connect to connect to the selected machine.

  4. In the Interaction field, enter the name of the interaction to call. This is defined in Oracle Studio.

  5. In the Input window, enter a statement to call the interaction. You can see an example in the above figure.

  6. Click Execute. If successful, you will get a return similar to the following example:

    <?xml version="1.0"?>
    <bigOrderEvent ORDER_ID="1"ORDERED_BY="1" xmlns+"noNamespace://ordersQueue"/>
    

Deploy a BPEL Outbound Process

This section describes how to create a BPEL outbound process that connects to a Tuxedo adapter. For information on how to configure a Tuxedo adapter for outbound, see

To configure a process with the BPEL process manager, you use JDeveloper. This section describes how to create a BPEL outbound process for Tuxedo adapters using JDeveloper. The following sections describe how to deploy a BPEL outbound process. There are two configuration types necessary to carry out this outbound sample.

Before you design the outbound process, make sure to integrate and connect your OracleAS adapter for Tuxedo with the BPEL process manager. See Chapter 7, "Integrating OracleAS Adapters for Tuxedowith Oracle BPEL Process Manager" for more information.

Beginning Tasks

Before you design the outbound process, you must carry out the following:

  • Integrate the OracleAS Adapter for VSAM with OC4J. See Integrating OracleAS Adapters for Tuxedo with OC4J for more information.

  • Configure the connection for the J2CA VSAM resource adapter. You do this by creating a connection factory. See Configuring the J2CA 1.5 Tuxedo Gateway Synchronous Inbound Adapter for information on how to do this.

  • Create a BPEL PM Server Connection in JDeveloper.

  • Create the WSDL for the interaction. You do this in JDeveloper Connections explorer before you begin to build your endpoint in JDeveloper. JDeveloper will create the WSDL automatically based on the interaction you create. In the Connections explorer, browse for the Oracle Connect server you configured in Oracle Studio (see Installing Oracle Connect on a Windows Platform), then double-click the findDoctor interaction to view and create the WSDL.

Design-Time Configuration

This section describes the design-time steps necessary to deploy two BPEL outbound processes. The processes use the Web service called TOUPPER. This service reads a string of lower-case letters and writes them in upper-case letters. The following are the steps required to create the outbound process.

Before You Begin

Before you design the outbound process, make sure to define the Toupper interaction using Oracle Studio. Then write a schema file called TOUPPERSchema.xsd to define the message schema. The following is an example of the TOUPPERSchema.xsd file:

<schema targetNamespace="http://xmlns.oracle.com/Esb/ToUpperData" xmlns:cust="http://xmlns.oracle.com/Esb/ToUpperData" xmlns="http://www.w3.org/2001/XMLSchema">  <element name="ToUpperData" type="cust:ToUpperDataType"/>  <complexType name="ToUpperDataType">    <sequence>      <element name="Record1" type="string"/>    </sequence>  </complexType></schema>

Create a BPEL Project for a BPEL Outbound Process

Do the following to create a BPEL project for outbound.

  1. In JDeveloper, from the View menu, select Application Navigator.

  2. In the Application Navigator, right-click the application you are working with and select New Project. The New Gallery dialog box is displayed.

  3. From the Items list, select BPEL Process Project then click OK. The BPEL Project Creation Wizard-Project Settings dialog box is displayed.

    Figure 4-9 Outbound Project Settings

    This screen shows the project settings
    Description of "Figure 4-9 Outbound Project Settings"

  4. Do the following in BPEL Project Creation Wizard-Project Settings dialog box:

    • Enter a name for the BPEL process, for example BPELOutbound1.

    • From the Template list, select Empty BPEL Process.

  5. Click Next to review the input/output schema elements or click Finish.

Create a File Adapter to Read the String

You create a file adapter to read a file as string input. SOA reads this string and passes it to a resource adapter. The resource adapter then processes the information in this string and returns it in Upper case. Do the following to create the file adapter.

  1. Drag a PartnerLink into a service lane of the visual editor. The Create Partner Link dialog box is displayed.

    Figure 4-10 Partner Link for File Adapter

    This image shows the Create Partner Link dialog box
    Description of "Figure 4-10 Partner Link for File Adapter"

  2. Click the Adapter Wizard button. This is the third button in the WDSL Settings section of the Create Partner Link dialog box, as shown in the figure above.

  3. Enter the following information in the Adapter Configuration wizard:

    1. Step 1, Adapter Type: Select File Adapter.

    2. Step 2, Service Name: type ReadStr

    3. Step 3, Operation:

      Operation Type: select Read File

      Operation Name: Type ReadLowerStr

    4. Step 4, File Directories

      Directory Names are Specified as: Select Physical Path

      Directory for Incoming Files (physical path): Enter the full path to the folder where you want the incoming files, for example C:\temp.

    5. Step 5, File Filtering:

      Includes Files with Name Pattern: Enter *xml

    6. Step 6, File Polling:

      Polling Frequency: enter 1 then select seconds from the list.

    7. Step 7, Messages:

      Schema File URL: Enter TOUPPERSchema.xsd

      Schema Element: Enter ToUpperData

  4. Click Finish.

Design a BPEL Outbound Process to Read the String

In this step, you design the BPEL process. Do the following to design the BPEL outbound process:

  1. From the Component Palette-Process Activities pane, drag a Receive, Assign, and Invoke activity into the editor for the process you created in the Create a BPEL Project for a BPEL Outbound Process step.

    Figure 4-11 Outbound Process

    This image shows where you create a process
    Description of "Figure 4-11 Outbound Process"

  2. In the Visual Editor, connect the Recieve_1 activity to the ReadStr file adapter. The Edit Receive dialog box is displayed.

    Figure 4-12 Outbound Receive Properties

    This screen shows the Edit Receive dialog box
    Description of "Figure 4-12 Outbound Receive Properties"

  3. Do the following in the Edit Receive dialog box:

    • Enter a name for the Receive activity, in this example it is Receive_1.

    • Make sure to create the variable. Click the first button to the right of the Variable field, then click OK in the Create Variable dialog box that is displayed.

    • Make sure that the Create Instance check box is selected.

    • Click OK to close the dialog box and accept the information.

Create a Partner Link to the Tuxedo Adapter

In this step, create a partner link to the Tuxedo adapter you are working with. Do the following to create a partner link.

  1. Drag a PartnerLink into a service lane of the visual editor. The Create Partner Link dialog box is displayed.

    Figure 4-13 Partner Link to Tuxedo Outbound

    This image shows the Create Partner Link dialog box
    Description of "Figure 4-13 Partner Link to Tuxedo Outbound"

  2. From the Create Partner Link dialog box, click the Service Explorer button. This button is the second form the left and is shown in the figure in the previous step. The Service Explorer dialog box is displayed.

  3. In the Service Explorer, expand the connection you are using, then expand adapters and then applications, and continue to browse until you find the WDSL file you are using. Select the file and click OK.

    The WSDL File field in the Create Partner Link dialog box displays the path to the WSDL file you selected. The Partner Link Type field displays the Partner Link defined in the WSDL file.

  4. Enter the following information in the Create Partner Link dialog box:

    • In the Partner Role list, select TOUPPERRole.

    • In the My Role list, select Not Specified.

Edit the Invoke_1 Activity

Edit the Invoke_1 activity that you added to the Visual Editor so that it will invoke the TOUPPER service. Do the following to edit the Invoke_1 activity.

  1. Double-click the Invoke_1 activity to edit it. The Invoke dialog box is displayed.

    Figure 4-14 Invoke Dialog Box

    This image shows the Invoke dialog box
    Description of "Figure 4-14 Invoke Dialog Box"

  2. In the Invoke dialog box, make sure that the Partner Role Web Service Interface section has the following values:

    • Partner Link: TOUPPER

    • Operation: TOUPPER

  3. Click the Automatically Create Input Variable button. It is the first icon to the right of the Input Variable field as shown in the figure in the previous step. The Create Variable dialog appears with the input variable.

  4. The Input Variable should be Invoke_1_TOUPPER_InputVariable. Click OK.

  5. Click the Automatically Create Input Variable button for the Output Variable field.

  6. The Output Variable should be Invoke_1_TOUPPER_OutputVariable. Click OK.

Edit the Assign_1 Activity

You use the assign activity to assign a value to the resource adapter. Do the following to edit the Assign_1 activity.

  1. Double-click the Assign_1 activity to edit it. The Assign dialog box is displayed.

    Figure 4-15 Assign Dialog Box

    This image shows the Assign dialog box
    Description of "Figure 4-15 Assign Dialog Box"

  2. Click the Create list and select Copy Operation. The Create Copy Operation dialog box is displayed.

  3. On the From side, expand Variables then expand Read_1_ReadLowerStr_InputVariable, then expand nsx:ToUpperData and select Record1.

  4. On the To side, expand Variables then expand Read_1_ReadLowerStr_InputVariable, then expand input:ToUPPER, then expand nsx:Record1 and select Record1_data.

  5. Click OK. The Copy Operation tab in the Assign window updates to show the rule.

Create a Process to Write the Upper-Case Letter String

After you create a process that reads a string of lower-case letters, create another process that will write the string in upper case letters. Do the following to create a process that will write the string in upper-case letters.

  1. Create a file adapter as described in Create a File Adapter to Read the String. To write the string, use the following values:

    • Service Name: WriteStr

    • Operation Type: Write File

    • Operation Name: WriteUpperStr

    • Directory for Incoming Files: C:\tempOut

    • File Naming Pattern: *.xml

  2. Add an Assign activity and an Invoke activity to the visual editor.

  3. Double-click the Invoke_2 activity to edit it. See Edit the Invoke_1 Activity for an explanation on how to edit an invoke activity. Use the following values for the Invoke_2 activity:

    • Partner Link: WriteStr

    • Operation: WriteStr

    • Input Variable: Invoke_2_WriteStr_InputVariable

    • Output Variable: Invoke_1_TOUPPER_OutputVariable

  4. Double-click the Assign_2 activity to edit it. See Edit the Assign_1 Activity for an explanation on how to edit an Assign activity. Use the following values for the Assign_2 activity:

    • From: Expand Variables then expand Invoke_1_TOUPPER_InputVariable, then expand output:ToUPPER, then expand nsx:TOUPPER_Response and select Record1_data.

    • To: Expand Variables then expand Invoke_2_1_WriteStr_InputVariable, then expand ToUpperData, then expand nsx:ToUpperData and select Record1.

The following figure shows how the final process looks:

Figure 4-17 Final Outbound Process

This image shows a final oubound process in JDeveloper
Description of "Figure 4-17 Final Outbound Process"

Runtime Configuration

This section describes how to test the project and run it to see that the outbound process is executed successfully. Do the following to test the outbound process.

  1. Create a file and call it ToUpperIn.xml as shown in the following example:

    <?xml version="1.0" encoding="UTF-8"?><CU:ToUpperData  xmlns:CU="http://xmlns.oracle.com/Esb/ToUpperData"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">       <Record1>tuxedo</Record1></CU:ToUpperData>
    
  2. Save the file to the C:/temp folder that was defined for the first file adapter. The file is deleted after the SOA server reads the file and complete the process.

  3. Open the C:\tempOut folder that was defined in the second file adapter. A file with the following contents is copied to this folder.

    <?xml version="1.0"?>
    <ToUpperData xmlns="http://xmlns.oracle.com/Esb/ToUpperData">
      <Record1 xmlns>="">TUXEDO</Record1>