Skip Headers
Oracle® Application Server Adapter for J.D. Edwards OneWorld User's Guide
10g Release 2 (10.1.2)
B14059-02
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

5 BPEL Process Manager Integration Examples

This chapter contains the following examples:

Prerequisites

The following components must be configured:


See Also:

Oracle Application Server Adapters Installation Guide

Configuration Steps

The examples present all the configuration steps necessary for demonstrating service and event integration with J.D. Edwards. The following cross references identify where more information can be obtained.

  1. Create a J2CA configuration, as BPEL PM is only compatible with the J2CA Connector. See "Creating a Configuration for J2CA" for more information.

  2. Configure OracleAS Adapter for J.D. Edwards OneWorld for services and events. See Chapter 2, "Configuring OracleAS Adapter for J.D. Edwards One World" for more information.

J.D. Edwards OneWorld Event Integration

This example illustrates how OracleAS Adapter for J.D. Edwards OneWorld integrates with J.D. Edwards OneWorld to receive event data. The design time and runtime procedures are outlined in the following sections.

Design Time

Creating a Channel in Application Explorer

You must create a separate channel for every inbound J2CA service and select that channel when you generate WSDL for inbound interaction using Application Explorer.


Note:

If more than one inbound service share the same channel, event messages will not be delivered to the right BPEL process.

To create a channel:

  1. In Application Explorer, expand the JDEdwards node.

  2. Right-click the Channels node, and select Add Channels.

    The Add Channel dialog box is displayed.

    Add Channel dialog box
    Description of the illustration add_channel_dialog.gif

  3. In the Name field, enter a descriptive name for the channel.

  4. In the Description field, enter a description (optional).

  5. From the Protocol list, choose a protocol for your channel.

  6. Click Next.

    The dialog box is displayed for the selected listener.

    System tab
    Description of the illustration tcp_listener_dialog.gif

  7. Enter the location of the server in the Host field.

  8. Enter the port number of the channel in the Port Number field.

  9. Select the Synchronization type from the Synchronization Type list.

  10. Select Is Length Prefix for events that send data which is not in XML format. The TCP/IP event application must prefix the data with a 4-byte binary length field when writing the data to the TCP/IP port.

  11. Select Is XML for events that send data back in XML format. No preparser is required.

  12. Select Is Keep Alive to maintain a continuous communication between the event transaction and the channel.

  13. Click the preparser tab.

    User tab
    Description of the illustration preparser_tab.gif

    Enter values based on the table.

    Parameter Description
    User id* A valid user ID for J.D. Edwards OneWorld.
    User password* The password associated with the user ID.
    JDE environment* Your J.D. Edwards OneWorld environment. For more information about this parameter, see your J.D. Edwards OneWorld documentation or ask your OneWorld system administrator.
    Application XMLInterop or the application name in J.D. Edwards OneWorld. Optional.
    Server IP address* The name of the server on which J.D. Edwards OneWorld is running. This can be the name of the server, for example, JDEOW, or its IP address, for example, 123.45.67.89.
    Server Port* The port number on which the server is listening, for example, 6009.
    Schema style Choose a style from the list.

    Click OK.

    The channel is created, and shows under the Channels node. An X over the icon indicates that the channel is currently disconnected.


    Note:

    Do not start the channel, as it is managed by BPEL PM Server. If you start the channel for testing and debugging purposes, stop it before runtime.

Creating an Event

After you create a channel and verify that it is not started, you must first connect to a defined target in Application Explorer, and then generate WSDL manually using the command prompt. See Defining a Target to J.D. Edwards OneWorld for detailed instructions on how to define a target.

To connect to a defined target:

  1. Start Application Explorer and expand the Adapters node.

  2. Expand the JDEdwards node.

    A list of your defined targets is displayed.

    Disconnected JDE target
    Description of the illustration jde_jdeconnection1.gif

  3. Click the target name (for example, JDEConnection) under the JDEdwards node.

    The Connection dialog box displays the values you entered for connection parameters.

  4. Verify your connection parameters. If required, provide the password.

  5. Right-click the target name and select Connect.

    The x icon disappears, indicating that the node is connected.

    Connected JDE target
    Description of the illustration jde_jdeconnection2.gif

Generating WSDL

To generate WSDL from the command prompt, perform the following steps:

  1. Verify that orabpel-adapters.jar is in your classpath.

  2. Run obadapter.bat to set the environment.

  3. From the Windows Start menu, select OraBPELPM_Home > Oracle BPEL Process Manager > Developer Prompt.

  4. At the prompt, enter the following command:

    java oracle.tip.pc.infra.wsil.IWayWSILBrowser jcaHome\jcaConfig adapter target channel schemaPrefix wsdlFileName
    
    

    Where:

    • jcaHome is the path to your J2CA configuration

    • jcaConfig is the directory where your J2CA configuration is saved

    • adapter is the name of the adapter

    • target is the name of the target you are connected to in Application Explorer

    • channel is the name of the channel you have selected in Application Explorer

    • schemaPrefix is the prefix of your schema

    • wsdlFileName is the name of your WSDL file

    For example:

    I:\oracle\AS\adapters\application\tools>java oracle.tip.pc.infra.wsil.IWayWSILBrowser
    I:\oracle\AS\adapters\application\
    jca_sample JDEdwards JDE_target JDE_channel SalesOrder SalesOrder.wsdl
    
    

The WSDL file is created.

Creating a BPEL PM Server Connection

Before you design an inbound BPEL process, you must create a connection to your BPEL Server using JDeveloper. To create a server connection:

  1. Open JDeveloper.

  2. To display the connections, click the Connections tab at the bottom of the upper left pane in JDeveloper.

    The following menu is displayed.

    Create a new BPEL PM connection
    Description of the illustration bpel_30.gif

  3. Right-click BPEL Process Manager Server and select New BPEL Process Manager Connection.

    The Create BPEL Process Manager Connection - Welcome dialog box is displayed.

    BPEL Process Manager Connection Wizard welcome screen
    Description of the illustration bpel_31.gif

  4. Click Next.

    The Create BPEL Process Manager Connection dialog box is displayed.

    BPEL PM Server Connection Wizard-specify connection name
    Description of the illustration bpel_32.gif

  5. Specify a unique name for your BPEL Server connection and click Next.

  6. Specify a valid host name and port number for the BPEL PM Server you wish to connect to.

  7. Click Finish.

    Your newly created server connection is displayed in the Connections tab under the BPEL Process Manager Server node.

    New server connection is displayed in the Connections tab
    Description of the illustration bpel_34.gif

Designing the BPEL Process for the SalesOrder Inbound Service

To design a BPEL process for inbound interaction:

  1. Click the Applications tab and select a workspace for your project.

    JDeveloper Applications tab
    Description of the illustration bpel_35.gif

  2. Right-click the workspace and select New Project.

    The New Gallery window is displayed.

    New Gallery
    Description of the illustration bpel_1.gif

  3. From the Items list, select BPEL Process Project and click OK.

    The BPEL Process Project dialog box is displayed.

    BPEL Process Project dialog box
    Description of the illustration bpel_22a.gif

  4. Perform the following steps:

    1. Specify a name for the process.

      The Namespace field is updated automatically.

    2. From the Template drop-down list, select Empty BPEL Process.

    3. Click OK.

  5. From the Process Activities pane on the right, drag and drop a PartnerLink to the visual editor.

    The Create Partner Link dialog box is displayed.

    Create Partner Link window
    Description of the illustration bpel_4.gif

  6. Click the WSIL browser icon (second icon from the left above the WSDL File field).

    The WSDL Chooser dialog box is displayed.

    WSDL Chooser window
    Description of the illustration bpel_5.gif

  7. Expand your BPEL Server connection, then expand adapters, and then applications.

    The WSDL Chooser dialog box is displayed.

    WSDL tree
    Description of the illustration bpel_6.gif

  8. Select SalesOrder.wsdl and click OK.

    The Create Partner Link dialog box is displayed.

    Create Partner Link dialog box
    Description of the illustration bpel_24a.gif

    The WSDL File field displays the name and location of the selected WSDL file. The Partner Link Type field specifies the PartnerLink defined in the WSDL file.

    Perform the following steps:

    1. From the My Role drop-down list, select the default value SalesOrderRole.

    2. Leave the Partner Role field unspecified.

  9. Click Apply, and then OK.

    The new PartnerLink appears in the visual editor.

    JDeveloper visual editor showing the new PartnerLink
    Description of the illustration bpel_25a.gif

  10. From the Process Activities pane on the right, drag a Receive activity to the visual editor and place it in the designated placeholder labeled Drop Activity Here.

  11. Connect the Receive activity to the JDE_event PartnerLink.

    The Edit Receive dialog box is displayed.

    Edit Receive dialog box
    Description of the illustration bpel_26a.gif

    Perform the following steps:

    1. Specify a name for the Receive Activity, for example, Receive_SalesOrder.

    2. Click the first icon to the right of the Variable field, then click OK in the Create Variable dialog box that is displayed.

    3. Verify that the Create Instance check box is selected.

  12. Click Apply.

    The Receive dialog box should no longer display any warnings or errors.

  13. Click OK.

  14. Select Save from the File menu.

Deploying the BPEL Process for the Inbound Service

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

  2. Select Deploy > Your BPEL PM Server connection > Deploy to default domain.

  3. When prompted, enter your BPEL Process Manager password and click OK.

    The deployment process starts automatically after you enter the correct password.

    Successful compilation in JDeveloper
    Description of the illustration bpel_46.gif

Runtime

Triggering an Event in J.D. Edwards OneWorld

To trigger an event in J.D. Edwards OneWorld:

  1. Log in to your J.D. Edwards OneWorld system.

  2. In the Fast Path field of the J.D. Edwards OneWorld Explorer window, type G4211 and press Enter.

    Fast Path field
    Description of the illustration jde_eventtrigger.gif

  3. Right-click Sales Order Detail (P4210).

    Sales Order Detail selected and menu showing
    Description of the illustration jde_eventtrigger2.gif

  4. Select Prompt for > Values.

    The Processing Options dialog box is displayed.

    Processing Options dialog box
    Description of the illustration jde_eventtrigger3.gif

    Perform the following steps:

    1. Click the Interop tab.

    2. In the Transaction Type field, type JDESOOUT.

    3. Verify that the value in the Before/After Image Processing Blank field is 1.

  5. Click OK.

    The Sales Order Detail - (Customer Service Inquiry) window is displayed.

    Sales Order Detail window
    Description of the illustration jde_eventtrigger4.gif

  6. Click the Add icon (third icon from left).

  7. Enter the values as shown in the following screen.

    To move to a different field, use the Tab key on your keyboard.

    The correct order values
    Description of the illustration jde_eventtrigger5.gif

  8. Enter a value for Quantity Ordered and Item Number.

    For example:

    Sample values for Quantity Ordered and Item Number
    Description of the illustration jde_eventtrigger6.gif

  9. Click the first field in the second row and allow a few seconds for processing.

    The second row selected
    Description of the illustration jde_eventtrigger7.gif

  10. Click OK.

An event is triggered in the J.D. Edwards OneWorld system.

Verifying the Results

To verify your results:

  1. Log in to Oracle BPEL Console at

    http://host:port/BPELConsole 
    
    
  2. Enter the password for your BPEL domain.

    The default password is bpel.

  3. Click the Instances tab.

    Recently received runtime events are displayed in the Instances tab.

    Instances tab
    Description of the illustration bpel_36.gif

  4. Click your J.D. Edwards event instance, then click Audit to see the received event message.

    Audit tab
    Description of the illustration bpel_37.gif

J.D. Edwards OneWorld Service Integration

This topic illustrates J.D. Edwards service integration. The procedures describe design time and runtime.

Design Time

Generating WSDL for GetEffectiveAddress

To generate WSDL for outbound interaction:

  1. Start Application Explorer and connect to a defined J.D. Edwards target.

  2. Expand Services > JDEJAVA_CFIN > B0100033, and select GetEffectiveAddress.

  3. Right-click GetEffectiveAddress.

    The following menu is displayed.

    Export WSDL dialog box
    Description of the illustration wlae_exportwsdl.gif

  4. Select Create Outbound JCA Service (Request/Response).

    The Export WSDL dialog box is displayed.

    Export WSDL dialog box
    Description of the illustration wlae_exportwsdl2.gif

  5. Accept the default name and location for the file.

    The .wsdl file extension is added automatically.

  6. Click OK.

    The WSDL file is created.

Creating a BPEL PM Server Connection

Before you design an outbound BPEL process, you must create a connection to your BPEL Server using JDeveloper. See Creating a BPEL PM Server Connection for details on how to create the connection.

Creating a BPEL Project for a Synchronous BPEL Process

To create a BPEL Project for a synchronous BPEL process:

  1. At the bottom of the upper left pane, click the Applications tab and select a workspace for your project.

    JDeveloper Applications tab
    Description of the illustration bpel_35.gif

  2. Right-click the workspace and select New Project.

    The New Gallery window is displayed.

    New Gallery
    Description of the illustration bpel_1.gif

  3. From the Items list, select BPEL Process Project and click OK.

    The BPEL Process Project dialog box is displayed.

    BPEL Process Project dialog box
    Description of the illustration bpel_2a.gif

  4. Perform the following steps:

    1. Specify a name for the BPEL process, for example, JDE_Service.

      The Namespace field is updated automatically.

    2. From the Template drop-down list, select Synchronous BPEL Process.

  5. Click OK.

Designing the BPEL Process for GetEffectiveAddress (Outbound Service)

To design the BPEL Process:

  1. From the Process Activities pane on the right, drag and drop a PartnerLink to the visual editor.

    The Create Partner Link dialog box is displayed.

    Create Partner Link window
    Description of the illustration bpel_4.gif

  2. Click the WSIL browser icon (second icon from the left above the WSDL File field).

    The WSDL Chooser dialog box is displayed.

    WSDL Chooser window
    Description of the illustration bpel_5.gif

  3. Expand your new server connection, then expand adapters, and then applications.

    The WSDL Chooser dialog box is displayed.

    WSDL tree
    Description of the illustration bpel_6.gif

  4. Select GetEffectiveAddress_invoke.wsdl and click OK.

    The WSDL File field in the Create Partner Link dialog box displays the name and location of the selected WSDL file. The Partner Link Type field specifies the PartnerLink defined in the WSDL file.

    Create Partner Link
    Description of the illustration bpel_7.gif

    Perform the following steps:

    1. Leave the My Role field unspecified. The role of the PartnerLink is null, as it will be synchronously invoked from the BPEL process.

    2. From the Partner Role drop-down list, select the default value GetEffectiveAddressRole. This is the role of the BPEL process.

  5. Click OK.

    The new PartnerLink appears in the visual editor.

  6. Select Save from the File menu.

  7. From the Process Activities pane on the right, drag an Invoke activity to the visual editor and place it between the Receive activity (receiveInput) and the Reply activity (replyOutput).

    The Invoke process activity is shown in the following diagram view.

    Diagram View of JDeveloper showing the new activities
    Description of the illustration bpel_42.gif

  8. Drag the blue arrow from Invoke_1 and connect it to the JDE_Service_PL PartnerLink.

    The Edit Invoke dialog box is displayed.

    Edit Invoke dialog box
    Description of the illustration bpel_43.gif

    Perform the following steps:

    1. Provide a name for the Invoke activity, for example, JDE_GetEffectiveAddress.

    2. Click the first icon to the right of the Input Variable field, then click OK in the Create Variable window that is displayed.

    3. Repeat the previous step to create a default variable for Output Variable.

  9. Click OK.

  10. Drag an Assign process activity and drop it between receiveInput and JDE_GetEffectiveAddress.

    The following image shows the new Assign activity in JDeveloper visual editor.

    JDeveloper diagram view showing new process activities
    Description of the illustration bpel_44.gif

  11. Double-click the Assign activity icon.

    The Assign dialog box is displayed.

    Assign dialog box
    Description of the illustration bpel_14.gif

  12. In the Copy Rules tab, click Create.

    The Create Copy Rule dialog box is displayed.

    1. In the From pane, expand Variables, then inputVariable, and then highlight payload.

    2. In the To pane, expand Variables, then JDE_GetEffectiveAddress_GetEffectiveAddress_InputVariable, and then highlight input_GetEffectiveAddress.

    Your Create Copy Rule dialog box should look as follows:

    Create Copy Rule dialog box
    Description of the illustration bpel_10a.gif

  13. To close the Create Copy Rule dialog box and the Assign dialog box, click OK.

  14. From the Process Activities pane on the right, drag another Assign activity to the visual editor and place it between the Invoke activity (JDE_GetEffectiveAddress) and the Reply activity (replyOutput).

  15. Double-click the Assign activity icon and click Create.

  16. Map JDE_GetEffectiveAddress_GetEffectiveAddress_OutputVariable > output_GetEffectiveAddress to outputVariable > payload.

    Verify that you have mapped all variables as follows:

    Create Copy Rule dialog box
    Description of the illustration bpel_10b.gif

  17. Click OK, then click OK again.

  18. Select Save from the File menu.

You have completed the design of your BPEL process.

Deploying the BPEL Process for GetEffectiveAddress (Outbound Service)

JDeveloper deploys BPEL processes directly to Oracle BPEL Console.

To deploy your BPEL process in JDeveloper:

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

  2. Select Deploy > Your BPEL PM Server connection > Deploy to default domain.

    The Password Prompt dialog box is displayed.

  3. Enter your BPEL Process Manager password in the Password Prompt dialog box.

    The deployment process starts automatically after you enter the correct password.

  4. Observe the Messages log on the bottom of the window.

    The Messages log displays the deployment status. In this example, it shows a successful deployment message for the process.

    Messages log
    Description of the illustration bpel_45.gif

    If deployment was not successful, click the Compiler tab to view all error and warning messages generated during the deployment process.

Runtime

To invoke the GetEffectiveAddress process from Oracle BPEL Console:

  1. Start the Oracle BPEL Console by entering the following URL in a browser:

    http://host:port/BPELConsole
    
    
  2. Select a domain and provide a valid password.

    The Oracle BPEL Console main page is displayed.

  3. Click the BPEL Processes tab.

    Your deployed processes are displayed in this tab.

    BPEL Processes tab in Oracle BPEL Console
    Description of the illustration bpel_47.gif

  4. Click the JDE Service process link, JDE_Service.

  5. Click the Initiate tab.

    The Initiate tab enables you to test your BPEL process.

    Initiate tab in Oracle BPEL Console
    Description of the illustration bpel_20.gif

    Perform the following steps:

    1. From the Initiating a test instance drop-down menu, select XML Source.

    2. Enter the following code in the text area provided for XML input:

      <?xml version="1.0" encoding="UTF-8"?>
      <jdeRequest type="callmethod"><callMethod name="GetEffectiveAddress" runOnError="no"><params><param name="mnAddressNumber">99999</param><param name="jdDateBeginningEffective"/><param name="cEffectiveDateExistence10"/><param name="szAddressLine1"/><param name="szAddressLine2"/><param name="szAddressLine3"/><param name="szAddressLine4"/><param name="szZipCodePostal"/><param name="szCity"/><param name="szCountyAddress"/><param name="szState"/><param name="szCountry"/><param name="szUserid"/><param name="szProgramid"/><param name="jdDateupdated"/><param name="szWorkstationid"/><param name="mnTimelastupdated"/><param name="szNamealpha"/></params><onError abort="yes"/></callMethod></jdeRequest>
      
      
  6. Click Post XML Message.

    Click the Audit tab to view the response received from the J.D. Edwards system.

    Response from JDE system
    Description of the illustration bpel_48.gif