6 Creating the Project in JDeveloper 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.

  • Personal computer running Microsoft Windows XP, Windows Vista, Windows Server 2003, or Windows Server 2008 with one GB of RAM.

  • The Tuxedo adapter that you are using (Tuxedo orTuxedo Queue) must be deployed to the Oracle Application Server.

  • OracleAS Tuxedo Adapter must be configured for outbound or inbound processing. See fix link.

  • Oracle JDeveloper must be installed.

  • Legacy adapter must be deployed.

  • Oracle Studio with the necessary machines loaded. See Configuring OracleAS Adapters for Tuxedo in Oracle Studio.

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 fix link.

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 perform this inbound sample.

Before you design the inbound process, you integrate and connect your OracleAS adapter for Tuxedo with the BPEL process manager. See Integrating OracleAS Adapters for Tuxedo for more information.

Beginning Tasks

Before you design the inbound process, you must perform the following:

  • Integrate the OracleAS Adapter for VSAM. See Integrating OracleAS Adapters for Tuxedo with WebLogic 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 and binding file for the interaction. You do this in Oracle Studio before you begin to build your endpoint in JDeveloper. Oracle Studio creates the WSDL and binding (jca) files automatically based on the interaction you create. See fix link for information on creating these files.

Design-Time Configuration

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

Create a BPEL Inbound Process

Perform the following to create a BPEL project for inbound.

  1. In JDeveloper, create a new SOA project

  2. Right-click the SOA project and select New. The New Gallery is displayed as shown in Figure 6-1.

  3. In the Categories list, expand SOA Tier and select Service Components.

  4. From the Items list, select BPEL Process then click OK. The Create BPEL Process screen is displayed as shown in Figure 6-2.

  5. Enter the following in the BPEL Process screen:

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

    • From the Template list, select Define Service Later.

  6. Click OK. The BPEL process is displayed in the visual editor.

Continue with Use a Third-Party Adapter for the Inbound Process.

Use a Third-Party Adapter for the Inbound Process

You use a third-pary adapter as a partner link to create the inbound process. SOA executes the SQL statement defined in the interaction and passes it to a resource adapter. Perform the following to create the third-party adapter.

  1. From the Projects area, on the left side, double-click the composite.xml. At the bottom of the visual editor, click the Design tab, if necessary. Figure 6-3 shows the Composite view in the visual editor.

    Figure 6-3 Composite View

    Composite view
    Description of "Figure 6-3 Composite View"

  2. Drag a third-pary adapter into the Exposed Services lane of the visual editor, as shown in Figure 6-4.

    Figure 6-4 Third-Party Adapter

    Third-party adapter
    Description of "Figure 6-4 Third-Party Adapter"

    When you drag the third-party adapter into JDeveloper, the Create Third Party Adapter Service screen is displayed as shown in Figure 6-5.

    Figure 6-5 Create Third-Party Adapter Service

    Third Party Adapter Service
    Description of "Figure 6-5 Create Third-Party Adapter Service"

  3. Click the button next to the WSDL URL field and browse to the WSDL file you are using.

  4. In the Type list, select Service.

  5. Click the button next to the JCA File field and browse to the binding file you are using.

  6. Click OK to close. You should now have a composite design as shown in Figure 6-6.

    Figure 6-6 Ready to Create BPEL Process (Composite View)

    Ready to create BPEL process
    Description of "Figure 6-6 Ready to Create BPEL Process (Composite View)"

    Continue with Design the BPEL Inbound Process.

Design the BPEL Inbound Process

Before you begin to design the inbound process procedure,you may need to configure some activation spec properties in the binding (jca) file. For more information on working with the inbound binding file, see Configuring the Binding for Tuxedo Queue Inbound Interactions.

Do the following to define the BPEL inbound process.

  1. In the Composite, connect the BPEL process to the third-pary adapter as shown in Figure 6-7.

    Figure 6-7 Connect to Third-Party Adapter

    Connect to third-party adapter
    Description of "Figure 6-7 Connect to Third-Party Adapter"

  2. Double-click the BPEL Process.

  3. From the Component Palette, BPEL Process Activities section, drag a Receive, Assign, and Invoke process into the editor as shown in Figure 6-8.

    Figure 6-8 Inbound Process

    Create a process
    Description of "Figure 6-8 Inbound Process"

  4. In the Visual Editor, connect the Receive activity to the third-party adapter service (Service1). The Edit Receive dialog box is displayed as shown in Figure 6-9.

    Figure 6-9 Receive Properties

    This screen shows the Edit Receive dialog box
    Description of "Figure 6-9 Receive Properties"

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

    • Enter a name for the Receive activity.

    • Create the variable. Click the plus sign to the right of the Variable field, then click OK in the Create Variable dialog box that is displayed.

    • Ensure that the Create Instance check box is selected.

  6. Click OK to close the dialog box and accept the information then Deploy the Project.

Deploy the Project

Perform the following to deploy the project to the Oracle Application Server:

  1. From the Application Navigator, right-click the project and find Deploy and then select the project you are deploying.

  2. From the Deploy wizard, select Deploy to Application Server.

  3. Continue to click Next till the end of the wizard and then click Finish to deploy.

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.

Run-time 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 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 6-10 Trigger for Inbound Process

    This figure shows an XML for inbound process
    Description of "Figure 6-10 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 get a return similar to the following example:

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

Mediator Inbound Process

This section describes how to create a Mediator inbound process that connects to a OracleAS adapter for Tuxedo.

You use JDeveloper to configure a process with Mediator. This sectino describes how to create a Mediator outbound process for Tuxedo resource adapters using JDeveloper. The following topics describe thow to deploy a BPEL outbound process.

Beginning Tasks

Before you design the inbound process, you must perform the following:

  • Integrate the OracleAS Adapter for VSAM. See Integrating OracleAS Adapters for Tuxedo with WebLogic 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.

  • Create the WSDL and binding file for the interaction. You do this in Oracle Studio before you begin to build your endpoint in JDeveloper. Oracle Studio creates the WSDL and binding (jca) files automatically based on the interaction you create. See fix link for information on creating these files.

Create a Mediator Inbound Process

Perform the following to create an inbound Mediator project.

  1. In JDeveloper, create a new SOA project

  2. Right-click the SOA project and select New. The New Gallery is displayed as shown in Figure 6-11.

  3. In the Categories list, expand SOA Tier and select Service Components.

  4. From the Items list, select Mediator then click OK. The Create Mediator screen is displayed as shown in Figure 6-12.

  5. Enter the following in the BPEL Process screen:

    • Enter a name for the Mediator process, for example MedInbound1.

    • From the Template list, select Define Service Later.

  6. Click OK. The Mediator process is displayed in the visual editor.

Continue with Use a Third-Party Adapter for the Inbound Process.

Use a Third-Party Adapter for the Inbound Process

You use a third-pary adapter as a partner link to create the inbound Mediator. SOA executes the SQL statement defined in the interaction and passes it to a resource adapter. Perform the following to create the third-party adapter.

  1. From the Projects area, on the left side, double-click the composite.xml. At the bottom of the visual editor, click the Design tab, if necessary. Figure 6-13 shows the Composite view in the visual editor.

    Figure 6-13 Composite View

    Composite view
    Description of "Figure 6-13 Composite View"

  2. Drag a third-pary adapter into the Exposed Services lane of the visual editor, as shown in Figure 6-14.

    Figure 6-14 Third-Party Adapter

    Third-party adapter
    Description of "Figure 6-14 Third-Party Adapter"

    When you drag the third-party adapter into JDeveloper, the Create Third Party Adapter Service screen is displayed as shown in Figure 6-15.

    Figure 6-15 Create Third-Party Adapter Service

    Third Party Adapter Service
    Description of "Figure 6-15 Create Third-Party Adapter Service"

  3. Click the button next to the WSDL URL field and browse to the WSDL file you are using.

  4. In the Type list, select Service.

  5. Click the button next to the JCA File field and browse to the binding file you are using.

  6. Click OK to close. You should now have a composite design as shown in Figure 6-16.

    Figure 6-16 Ready to Create Mediator (Composite View)

    Ready to create BPEL process
    Description of "Figure 6-16 Ready to Create Mediator (Composite View)"

    Continue with Create a File Adapter.

Create a File Adapter

Perform the following to create a file adapter.

  1. In the Composite, connect the Mediator to the third-party adapter.

  2. From the component pallet, SOA section, on the right, drag a file adapter into the External References lane of the visual editor. The Adapter Configuration wizard is displayed.

  3. In the first screen of the Adapter Configuration wizard, enter a name for the adapter service, and click next.

  4. In the Adapter Interface screen, select the same WSDL file as you selected in Use a Third-Party Adapter for the Inbound Process. Figure 6-17 shows the Adapter Interface screen.

  5. Click Next to use the default settings for each of the remaining screens in the wizard. When you get to the end click Finish.

  6. Connect Mediator to the file adapter and select the operations.

Continue with Design an Inbound Mediator.

Design an Inbound Mediator

In this step, you design the BPEL process. Perform the following ot design the inbound Mediator.

  1. In the Composite, double-click the Mediator.

  2. Create a static routing rule.

  3. Expand the Filter Expression as shown in Figure 6-18.

    Figure 6-18 Filter Expression

    The Filter Expression Screen
    Description of "Figure 6-18 Filter Expression"

  4. Continue with Create Mapping Rules and Map the Files.

Create Mapping Rules and Map the Files

You must perform the following steps to create mapping files and map the files.

  1. In the Filter Expression screen, click the icon next to the Transform using field as shown in Figure 6-18. The Request Transformation Map screen is displayed as shown in Figure 6-19.

    Figure 6-19 Request Transformation Map

    Request Transformation Map
    Description of "Figure 6-19 Request Transformation Map"

  2. In the Request Transformation Map, select Create New Mapper file. Use the default value.

  3. Click OK.

  4. In the visual editor, click to return to the mediator.mplan tab.

  5. Click the tab for the Mapper File that you created. Connect the elements.

  6. Save and then Deploy the Project.

Deploy the Project

Perform the following to deploy the project to the Oracle Application Server:

  1. From the Application Navigator, right-click the project and find Deploy and then select the project you are deploying.

  2. From the Deploy wizard, select Deploy to Application Server.

  3. Continue to click Next till the end of the wizard and then click Finish to deploy.

Deploy a BPEL Outbound Process

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

To configure a process the BPEL Process Manager, you use JDeveloper. This section describes how to create a BPEL outbound process for Tuxedo adapters using JDeveloper. This section contains the following topics.

Before you design the outbound process, you integrate and connect your OracleAS adapter for Tuxedo with the BPEL process manager. See Chapter 4, "Integrating OracleAS Adapters for Tuxedo" for more information.

Beginning Tasks

Before you design the outbound process, you must perform the following:

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

  • Configure the connection for the J2CA VSAM resource adapter. You do this by creating a connection factory. See Configuring the 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 creates 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 Oracle Application Server Legacy Adapters Installation Guide), 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, you define the Toupper interaction using Oracle Studio as described in Creating Outbound Interactions with the OracleAS Adapter for Tuxedo.

Create a BPEL Project for a BPEL Outbound Process

Perform the following tasks 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 6-20 Outbound Project Settings

    Project settings for the outbound process
    Description of "Figure 6-20 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 6-21 Partner Link for File Adapter

    This image shows the Create Partner Link dialog box
    Description of "Figure 6-21 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 6-22 Outbound Process

    This image shows where you create a process
    Description of "Figure 6-22 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 6-23 Outbound Receive Properties

    This screen shows the Edit Receive dialog box
    Description of "Figure 6-23 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.

    • 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.

    • Ensure 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 6-24 Partner Link to Tuxedo Outbound

    This image shows the Create Partner Link dialog box
    Description of "Figure 6-24 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 invokes 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 6-25 Invoke Dialog Box

    This image shows the Invoke dialog box
    Description of "Figure 6-25 Invoke Dialog Box"

  2. In the Invoke dialog box, ensure 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 6-26 Assign Dialog Box

    This image shows the Assign dialog box
    Description of "Figure 6-26 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 writes the string in upper case letters. Do the following to create a process that writes 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 6-28 Final Outbound Process

This image shows a final oubound process in JDeveloper
Description of "Figure 6-28 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>