Oracle® Application Server Adapter for J.D. Edwards OneWorld User's Guide 10g Release 2 (10.1.2) B14059-03 |
|
Previous |
Next |
This chapter contains the following examples:
The scenarios shown in this chapter require the following prerequisites.
Prerequisites
The following are installation and configuration requirements:
OracleAS Adapter for J.D. Edwards OneWorld must be installed on Oracle Application Server.
Oracle BPEL PM Server must be properly configured and running.
Oracle JDeveloper must be properly installed.
See Also: Oracle Application Server Adapters Installation Guide |
The examples in this chapter present the configuration steps necessary for demonstrating service and event integration with J.D. Edwards OneWorld. Prior to using this material, you must be familiar with the following:
How to create a J2CA configuration, as BPEL PM is only compatible with the J2CA Connector. See "Creating a Configuration for J2CA" for more information.
How to configure OracleAS Adapter for J.D. Edwards OneWorld for services and events using Application Explorer. See Chapter 2, "Configuring OracleAS Adapter for J.D. Edwards One World" for more information.
See Also: Oracle BPEL Process Manager Developer's Guide |
Adapter integration with Oracle BPEL Process Manager is a two-step process:
Design Time: OracleAS Adapter for J.D. Edwards OneWorld is configured in Application Explorer for services and events, as described in Chapter 2, "Configuring OracleAS Adapter for J.D. Edwards One World". Integration logic is modeled using JDeveloper.
Runtime: After you deploy the BPEL process you designed in JDeveloper, you can test your service configuration or see newly received events in the BPEL Console.
This topic illustrates J.D. Edwards service integration. The design-time and runtime procedures are described below.
Generating WSDL for Request/Response Service
To generate WSDL for outbound interaction:
Start Application Explorer and connect to a defined J.D. Edwards target.
Expand Services, JDEJAVA_CFIN, B0100033, and then select GetEffectiveAddress.
Right-click GetEffectiveAddress.
The following menu is displayed.
Select Create Outbound JCA Service (Request/Response).
The Export WSDL dialog box is displayed.
Accept the default name and location for the file.
The .wsdl file extension is added automatically.
Click OK.
The WSDL file is created.
Creating a BPEL PM Server Connection
Before you design a BPEL process, you must create a connection to your BPEL Server using JDeveloper. To create a server connection:
Open JDeveloper.
To display the connections, click the Connections tab at the bottom of the upper left pane in JDeveloper.
The following menu is displayed.
Right-click BPEL Process Manager Server and select New BPEL Process Manager Connection.
The Create BPEL Process Manager Connection - Welcome dialog box is displayed.
Click Next.
The Create BPEL Process Manager Connection dialog box is displayed.
Specify a unique name for your BPEL Server connection and click Next.
The Create BPEL Process Manager Connection dialog box is displayed.
Specify a valid host name and port number for the BPEL PM Server you wish to connect to.
Click Finish.
Your newly created server connection is displayed in the Connections tab under the BPEL Process Manager Server node.
Creating a BPEL Project for a Synchronous BPEL Process
To create a BPEL Project for a synchronous BPEL process:
At the bottom of the upper left pane, click the Applications tab and select a workspace for your project.
Right-click the workspace and select New Project.
The New Gallery window is displayed.
From the Items list, select BPEL Process Project and click OK.
The BPEL Process Project dialog box is displayed.
Perform the following steps:
Specify a name for the BPEL process, for example, JDE_Service.
The Namespace field is updated automatically.
From the Template list, select Synchronous BPEL Process.
Click OK.
Designing the BPEL Process for GetEffectiveAddress (Outbound Service)
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.
Click the WSIL browser icon (second icon from the left preceding the WSDL File field).
The WSDL Chooser dialog box is displayed.
Expand your new server connection, then expand adapters, and then applications.
The WSDL Chooser dialog box is displayed.
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.
Perform the following steps:
Leave the My Role field unspecified. The role of the PartnerLink is null, as it will be synchronously invoked from the BPEL process.
From the Partner Role list, select the default value GetEffectiveAddressRole. This is the role of the BPEL process.
Click OK.
Select Save from the File menu.
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.
Drag the blue arrow from Invoke_1 and connect it to the JDE_Service_PL
PartnerLink.
The Edit Invoke dialog box is displayed.
Perform the following steps:
Click OK.
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.
Double-click the Assign activity icon.
The Assign dialog box is displayed.
In the Copy Rules tab, click Create.
The Create Copy Rule dialog box is displayed.
In the From pane, expand Variables, then inputVariable, and then highlight payload.
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:
To close the Create Copy Rule dialog box and the Assign dialog box, click OK.
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
).
Double-click the Assign activity icon and click Create.
Map JDE_GetEffectiveAddress_GetEffectiveAddress_OutputVariable, output_GetEffectiveAddress to outputVariable, payload.
Verify that you have mapped all variables as follows:
Click OK, and then click OK again.
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:
Right-click your process flow in the Applications - Navigator pane.
Select Deploy, then Your BPEL PM Server connection, and then Deploy to default domain.
The Password Prompt dialog box is displayed.
Enter your BPEL Process Manager password in the Password Prompt dialog box.
The deployment process starts automatically after you enter the correct password.
Observe the Messages log at the bottom of the window.
The Messages log displays the deployment status. In this example, it shows a successful deployment message for the process.
If deployment was not successful, click the Compiler tab to view all error and warning messages generated during the deployment process.
To invoke the GetEffectiveAddress process from Oracle BPEL Console:
Start the Oracle BPEL Console by entering the following URL in a browser:
http://host:port/BPELConsole
Select a domain and provide a valid password.
The Oracle BPEL Console main page is displayed.
Your deployed processes are displayed in this tab.
The Initiate tab enables you to test your BPEL process.
Perform the following steps:
From the Initiating a test instance list, select XML Source.
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>
Click Post XML Message.
Click the Audit tab to view the response received from the J.D. Edwards system.
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 configuration procedures are outlined in the following sections.
Before you design a BPEL process using JDeveloper, you must create a separate channel for every J2CA event and select that channel when you generate WSDL for inbound interaction using Application Explorer.
Note: If two or more events share the same channel, event messages may not be delivered to the right BPEL process. |
Creating a Channel in Application Explorer
To create a channel:
Right-click the Channels node, and select Add Channels.
The Add Channel dialog box is displayed.
In the Name field, enter a descriptive name for the channel.
In the Description field, enter a description (optional).
Click Next.
The dialog box is displayed for the selected listener.
Enter the location of the server in the Host field.
Enter the port number of the channel in the Port Number field.
Select the Synchronization type from the Synchronization Type list.
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.
Select Is XML for events that send data back in XML format. No preparser is required.
Select Is Keep Alive to maintain a continuous communication between the event transaction and the channel.
Enter values based on the table.
Click OK.
The channel is created and displayed under the Channels node. An X over the icon indicates that the channel is currently disconnected.
Generating WSDL for Event Notification (Command Prompt Only)
You cannot generate WSDL for J.D. Edwards OneWorld event notification using Application Explorer. To generate WSDL from the command prompt, you must perform the following steps.
Important: You can create inbound J2CA service only if the node you have selected supports events.
To generate a WSDL file for J.D. Edwards OneWorld event notification:
Create a channel in Application Explorer under the J.D. Edwards events node. See "Creating a Channel in Application Explorer" .
Start the channel.
Important: Do not restart the BPEL PM Server or Oracle Application Server after the channel is started.
Send an inbound message from J.D. Edwards OneWorld.
Capture the inbound message payload in the log file located under OracleAS_home
\adapters\application\config\jca_sample\log
Alternatively, you can create a port with the File protocol under Event in Application Explorer to dispose the event message to the file system.
Use a third party tool such as XMLSpy to create the XSD schema using the XML payload captured in the previous step.
Verify that orabpel-adapters.jar
is in your classpath.
Open a command prompt and change directory to: OracleAS_home
\adapters\application\tools
Run obadapter.bat
to set the environment.
Enter the following command to generate WSDL:
java oracle.tip.pc.infra.wsil.IWayWSILBrowser jcaHome\jcaConfig adapter target channel schemaPrefix wsdlFileName
Where:
jcaHome
is the path to your J2CA configuration. For example, OracleAS_home
\adapters\application\
jcaConfig
is the JCA configuration created in Application Explorer. The default is jca_sample
.
adapter
is the name of the adapter. For example, JDEdwards.
target
is the name of the adapter target you created under Adapter in Application Explorer
channel
is the name of the channel you have created under Event in Application Explorer
schemaPrefix
is the prefix of the XSD schema. The schema file must be in the same directory where the Java command is executed, for example, OracleAS_home
\adapters\application\tools
wsdlFileName
is the name of the WSDL file being created in this procedure
For example:
I:\oracle\AS\adapters\application\tools>java oracle.tip.pc.infra.wsil.IWayWSILBrowser I:\oracle\AS\adapters\application\ jca_sample JDEdwards JDE JDE SalesOrder SalesOrder.wsdl
Note: It is good practice to append_receive to the names of WSDL files generated for event notification services. This will allow you to easily differentiate between them and those generated for request-response services. |
Stop the channel in Application Explorer.
Note: You can organize your WSDL files in subfolders, creating your own WSDL hierarchy structure. Create the folders underOracleAS_home \adapters\application\wsdls\ . The WSIL browser in JDeveloper will display the full tree structure of your WSDL hierarchy. |
The WSDL file is created. You can now create a BPEL process that uses the WSDL as Partner Link. As the BPEL process is deployed, the channel is activated from BPEL PM. Then, after you send an inbound message from J.D. Edwards OneWorld, the message will be received by the channel started by BPEL PM. These procedures are described in detail in the following sections.
Creating a BPEL PM Server Connection
Before you design a 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.
Designing the BPEL Process for the SalesOrder Inbound Service
To design a BPEL process for inbound interaction:
Click the Applications tab and select a workspace for your project.
Right-click the workspace and select New Project.
The New Gallery window is displayed.
From the Items list, select BPEL Process Project and click OK.
The BPEL Process Project dialog box is displayed.
Perform the following steps:
Specify a name for the process.
The Namespace field is updated automatically.
From the Template list, select Empty BPEL Process.
Click OK.
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.
Click the WSIL browser icon (second icon from the left preceding the WSDL File field).
The WSDL Chooser dialog box is displayed.
Expand your BPEL Server connection, then expand adapters, and then applications.
The WSDL Chooser dialog box is displayed.
Select SalesOrder.wsdl and click OK.
The Create Partner Link dialog box is displayed.
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:
Click Apply, and then click OK.
The new PartnerLink appears in the visual editor.
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.
Connect the Receive activity to the JDE_event
PartnerLink.
The Edit Receive dialog box is displayed.
Perform the following steps:
Specify a name for the Receive Activity, for example, Receive_SalesOrder.
Click the first icon to the right of the Variable field, then click OK in the Create Variable dialog box that is displayed.
Verify that the Create Instance check box is selected.
Click Apply.
The Receive dialog box should no longer display any warnings or errors.
Click OK.
Select Save from the File menu.
Deploying the BPEL Process for the Inbound Service
Right-click your process flow in the Applications - Navigator pane.
Select Deploy, then Your BPEL PM Server connection, and then Deploy to default domain.
When prompted, enter your BPEL Process Manager password and click OK.
The deployment process starts automatically after you enter the correct password.
Events are generated as a result of activity in a database or in an application system. You can use events to trigger an action in your application. See "Configuring an Event Adapter" for more information on event configuration.
Triggering an Event in J.D. Edwards OneWorld
To trigger an event in J.D. Edwards OneWorld:
Log in to your J.D. Edwards OneWorld system.
In the Fast Path field of the J.D. Edwards OneWorld Explorer window, type G4211 and press Enter.
Right-click Sales Order Detail (P4210).
Select Prompt for, and then Values.
The Processing Options dialog box is displayed.
Perform the following steps:
Click the Interop tab.
In the Transaction Type field, type JDESOOUT.
Verify that the value in the Before/After Image Processing Blank field is 1.
Click OK.
The Sales Order Detail - (Customer Service Inquiry) window is displayed.
Click the Add icon (third icon from left).
Enter the values as shown in the following screen.
To move to a different field, use the Tab key on your keyboard.
Enter a value for Quantity Ordered and Item Number.
For example:
Click the first field in the second row and allow a few seconds for processing.
Click OK.
An event is triggered in the J.D. Edwards OneWorld system.
Log in to Oracle BPEL Console at
http://host:port/BPELConsole
Enter the password for your BPEL domain.
The default password is bpel
.
Recently received runtime events are displayed in the Instances tab.
Click your J.D. Edwards event instance, and then click Audit to see the received event message.