5 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. This section has the following topics:

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 and Mediator to work with the Oracle CDC adapters. You should be familiar with the following before working with these examples:

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

Beginning Tasks

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

Deploy a BPEL Inbound Process

This section describes how to create a BPEL inbound process that connects to an Adabas CDC adapter. For information on how to configure an Adabas CDC adapter for inbound, see Setting Up a Change Data Capture with the OracleAS CDC Adapter for Adabas.

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, make sure to integrate and connect your OracleAS CDC adapter for Adabas with the BPEL process manager. See Configuring the Adabas CDC Adapter In the Application Server for more information.

You must also make sure to enter the value for the JdbcDataSource in the jca file. shows where you add this value to the jca file.

Figure 5-1 JdbcDataSource Value

JdbcDataSource value

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 5-2.

    Figure 5-2 New Gallery

    Select a new BPEL Process
  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 5-3.

    Figure 5-3 BPEL Process

    BPEL Process
  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-party 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 5-4 shows the Composite view in the visual editor.

    Figure 5-4 Composite View

    Composite view
  2. Drag a third-party adapter into the Exposed Services lane of the visual editor, as shown in Figure 5-5.

    Figure 5-5 Third-Party Adapter

    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 5-6.

    Figure 5-6 Create Third-Party Adapter Service

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

    Figure 5-7 Ready to Create BPEL Process (Composite View)

    Ready to create BPEL process

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

Do the following to define the BPEL inbound process.

  1. In the Composite, connect the BPEL process to the third-party adapter as shown in Figure 5-8.

    Figure 5-8 Connect to Third-Party Adapter

    Connect to third-party adapter
  2. Double-click the BPEL Process.

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

    Figure 5-9 Inbound Process

    Create a 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 5-10.

    Figure 5-10 Receive Properties

    This screen shows the Edit Receive dialog box
  5. Do the following in the Edit Receive dialog box:

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

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

  6. Click the (x) in the visual editor as shown in Figure 5-11. The Variables screen is displayed.

    Figure 5-11 Add Variable

    Add variable
  7. In the Variables screen, click the Plus sign to open the Create Variable screen.

  8. In the Create Variable screen, select Message Type, and then click the icon next to the field to open the Type Chooser.

  9. In the Type Chooser, expand the files in the tree until you find the HOSPITALStream under the Message Types folder as shown in Figure 5-12.

    Figure 5-12 Type Chooser

    Type Chooser

    Click OK, then click OK in the Create Variable screen.

  10. Double-click the Assign_1 process to open the Assign screen.

  11. From the Assign screen, click the plus sign at the top as shown in and select Copy Operation. The Create Copy Operation screen is displayed as shown in Figure 5-13.

    Figure 5-13 Edit Copy Operation

    Edit copy operation
  12. From the Create Copy Operation screen, for both the From and To sides, expand Variable_1, then HOSPITALstream, then select ns2:HOSPITALstream as shown in Figure 5-13.

  13. Click OK to close the Create Copy Operation screen, then click OK to close the Assign screen and accept the information.

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

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 Triggering the Event using the XML Utility. Because this event is called from Oracle Connect it is an inbound event.

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 5-14 Trigger for Inbound Process

    This figure shows an XML 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 CDC Adapter for Adabas.

You use JDeveloper to configure a process with Mediator. This section describes how to create a Mediator inbound process for CDC resource adapters using JDeveloper. The following topics describe how to create a Mediator inbound process.

Beginning Tasks

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

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 5-15.

    Figure 5-15 New Gallery

    Select a new Mediator Process
  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 5-16.

    Figure 5-16 Mediator

    The Create Mediator step
  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-party 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 5-17 shows the Composite view in the visual editor.

    Figure 5-17 Composite View

    Composite view
  2. Drag a third-party adapter into the Exposed Services lane of the visual editor, as shown in Figure 5-18.

    Figure 5-18 Third-Party Adapter

    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 5-19.

    Figure 5-19 Create Third-Party Adapter Service

    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 5-20.

    Figure 5-20 Ready to Create Mediator (Composite View)

    Ready to create BPEL process

    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 Import an existing WSDL. Select the same WSDL file as you selected in Use a Third-Party Adapter for the Inbound Process. Figure 5-21 shows the Adapter Interface screen.

    Figure 5-21 File Adapter

    Create file adapter
  5. In the Operation screen, select Write File as the Operation Type.

  6. In the File Configuration screen, enter a path to the directory where the files are written, and also enter the file naming convention as shown in Figure 5-22.

    Figure 5-22 File Configuration Screen

    The File Configuration Screen
  7. Click Next to use the default settings for each of the remaining screens in the wizard. When you get to the end click Finish.

  8. Connect Mediator to the file adapter.

  9. In the Choose Operations screen, select the Hospital for both operations. Click OK.

Continue with Design an Inbound Mediator.

Design an Inbound Mediator

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

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

  2. Expand the Filter Expression as shown in Figure 5-23.

    Figure 5-23 Filter Expression

    The Filter Expression Screen
  3. 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 5-23. The Request Transformation Map screen is displayed as shown in Figure 5-24.

    Figure 5-24 Request Transformation Map

    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 the HOSPITALStream to HOSPITALStream tab. This displays the mapper.

  5. Connect the legacyReq:HOSPITALStream elements. This is shown in red in Figure 5-25. Then expand the nodes to see the connections.

    Note: The red line does not appear in JDeveloper.

    Figure 5-25 Mapper Screen

    Map the process
  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.