Skip Headers

Oracle E-Business Suite Integrated SOA Gateway Developer's Guide
Release 12.1
Part Number E12065-06
Go to Table of Contents
Contents
Go to previous page
Previous
Go to next page
Next

Using Business Service Objects

Overview

A business service object, formerly known as Service Bean, is a high-level service component that allows OA Framework or BC4J components to be deployed as Web services. It is the tool by which Oracle E-Business Suite employs service oriented architecture (SOA) and Web services to facilitate integration with each other and with third party trading partners.

Business service object interfaces provide access to SOA services to facilitate integration between Oracle E-Business Suite and trading partners. They often employ service data objects as parameters to pass complex data.

To better utilize these business service objects for broader customers, integration repository administrators can first generate Web services and then deploy them to the application server. Integration developers can orchestrate those deployed services into a meaning business process with service endpoints using a BPEL language. This process can take the data from a business partner and then insert or update Oracle E-Business Suite if necessary.

To better understand how to use business service object interfaces in updating Oracle E-Business Suite, detailed design-time and run-time tasks are included in this chapter. For the example described in the following sections, we use Oracle JDeveloper 10.1.3.3.0 as a design-time tool to create the BPEL process and use Oracle SOA Suite BPEL server 10.1.3.3.0 for the process deployment.

Using Business Service Object WSDLs at Design Time

BPEL Process Scenario

This example uses PurchaseOrderService /oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService business service object interface to explain the BPEL process creation.

When a purchase order approval request is received, the purchase order details is read by a File Adapter. The order data is then passed to the approvePurchaseOrder method within the PurchaseOrderService to initiate the single PO approval process. The approval information is then replied back to the requestor.

If the BPEL process is successfully executed after deployment, you should notice the purchase order status changed from Incomplete to Approved.

Prerequisites to Create a BPEL Process Using a Business Service Object Web Service

Generating and Deploying WSDL URL

An integration repository administrator must first create a Web service for a selected interface definition, and then deploy the service from Oracle Integration Repository to the application server.

For example, the administrator must perform the following steps before letting the integration developers use the deployed WSDL in creating a BPEL process:

  1. To generate a Web service, locate the business service object interface definition first from the Oracle Integration Repository (such as PurchaseOrderService /oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService) and click Generate WSDL in the interface details page.

    Since business service object interfaces are service enabled by using Web Service Provider, once the service is successfully generated, the Web Service - Web Service Provider region appears in the interface details page. For detailed instruction on how to generate a Web service, see Generating Web Services, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

  2. To deploy a generated Web service, select at least one authentication type and click Deploy in the Web Service - Web Service Provider region of the interface details page to deploy the service. Once the service is successfully deployed, the selected authentication type(s) will be displayed along with 'Deployed' Web Service Status. For more information on securing Web services with authentication types, see Managing Web Service Security, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

    For detailed instruction on how to deploy a Web service, see Deploying Web Services, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

Searching and Recording WSDL URL

Apart from the required tasks performed by the administrator, an integration developer also needs to log on to the system to locate and record the deployed Web service WSDL URL for the interface that needs to be orchestrated into a meaningful business process in Oracle JDeveloper using BPEL language.

This WSDL information will be used later in creating a partner link for the interface exposed as a Web service during the BPEL process creation at design time.

Confirming and Recording a Deployed WSDL URL

the picture is described in the document text

How to search for an interface and review the interface details, see Searching and Viewing Integration Interfaces.

Setting Header Variables for SOAP Request

You need to populate certain variables in the BPEL process for header elements to pass values that may be required to set application context during service execution. These header elements for Business Service Object interface type are RESPONSIBILITY_NAME, RESPONSIBILITY_APPL_NAME, SECURITY_GROUP_NAME, NLS_LANGUAGE, and ORG_ID.

Note: The user information is defined by the wsseUsername property passed within the security headers. Detailed instructions on how to pass the security headers along with the SOAP request, see Passing Values to Security Headers.

The expected values for these elements are described in the following table:

Header Variables and Expected Values for Business Service Object Interfaces
Element Name Expected Value
RESPONSIBILITY_NAME responsibility_name (such as "System Administrator") or {key}responsibility_key (such as "{key}SYSTEM_ADMINISTRATOR")
RESPONSIBILITY_APPL_NAME Application Short Name (such as "FND")
SECURITY_GROUP_NAME Security Group Key (such as "STANDARD")
NLS_LANGUAGE NLS Language (such as "AMERICAN")
ORG_ID Org ID (such as "202")

Note: NLS_Language and ORG_ID are optional values to be passed.

The context information can be specified by configuring an Assign activity before the Invoke activity in the BPEL PM.

Detailed information on how to set header variables for the SOAP request, see Assigning ServiceBean_Header Parameters.

BPEL Process Creation Flow

Based on the scenario, the following design-time tasks are discussed in this chapter:

  1. Create a new BPEL project

    Use this step to create a new BPEL project called ApprovePO.bpel. This automatically creates two dummy activities - Receive and Reply - to receive input from a third party application and to reply output of the BPEL process back to the request application.

  2. Create a Partner Link

    Use this step to create a partner link for PurchaseOrderService Web services.

  3. Add a Partner Link for File Adapter

    This is to synchronous read purchase order details received from the requestor.

  4. Add Invoke activities

    Use this step to create two Invoke activities in order to:

    1. Point to the File Adapter - Synchronous Read operation to read the purchase order from the input file.

    2. Point to the PurchaseOrderService Web service to initiate the single purchase order approval process.

  5. Add Assign activities

    Use this step to create three Assign activities in order to:

    1. To set the SOAHeader details.

    2. Pass the purchase order details read from the File Adapter as an input to the Invoke activity for PurchaseOrderService Web service.

    3. Pass single purchase order approval information to the requestor through the Reply activity.

For general information and basic concept of a BPEL process, see Understanding BPEL Business Processes and Oracle BPEL Process Manager Developer's Guide for details.

Creating a New BPEL Project

Use this step to create a new BPEL project that will contain various BPEL process activities.

To create a new BPEL project:

  1. Open JDeveloper BPEL Designer.

  2. From the File menu, select New. The New Gallery dialog box appears.

  3. Select All Items from the Filter By box. This produces a list of available categories.

  4. Expand the General node and then select Projects.

  5. Select BPEL Process Project from the Items group.

  6. Click OK. The BPEL Process Project dialog box appears.

    Entering BPEL Project Information

    the picture is described in the document text

  7. In the Name field, enter a descriptive name for example ApprovePO.

  8. From the Template list, select Synchronous BPEL Process and then select Use Default Project Settings.

  9. Use the default input and output schema elements in the Input/Output Elements dialog box.

  10. Click Finish.

    A new synchronous BPEL process is created with the Receive and Reply activities. The required source files including bpel.xml, using the name you specified (for example, ApprovePO.bpel) are also generated.

    New BPEL Process Diagram

    the picture is described in the document text

Creating a Partner Link

Use this step to configure a Partner Link called PurchaseOrderService.

To create a partner link for PurchaseOrderService:

  1. In JDeveloper BPEL Designer, drag and drop the PartnerLink service from the Component Palette into the Partner Link border area of the process diagram. The Service Name dialog box appears.

  2. Copy the WSDL URL corresponding to the PurchaseOrderService /oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService that you recorded earlier in the WSDL File field.

    A Partner Link Type message dialog box appears asking whether you want the system to create a new WSDL file that will by default create partner link types for you.

    Click Yes to have the PurchaseOrderService partner link created in the process diagram.

    The Partner Name and Partner Link Type values populated automatically. You can select the Partner Role value from the drop-down list.

    Click Apply.

    Editing the Partner LInk

    the picture is described in the document text

  3. Passing Values to Security Headers

    Select the Property tab and click the Create Property icon to select the following properties from the property name drop-down list in order to pass the security headers along with the SOAP request:

    Click Apply to save the selected property values.

    Adding Properties

    the picture is described in the document text

  4. Click OK to complete the partner link configuration. The partner link is created with the required WSDL settings, and is represented in the BPEL project by a new icon in the border area of the process diagram.

Adding a Partner Link for File Adapter

Use this step to synchronous read the purchase order details received from the third party application.

To add a Partner Link for File Adapter:

  1. In JDeveloper BPEL Designer, drag and drop the File Adapter service from the Adapter Service section of the Component Palette into the Partner Link area of the process diagram. The Adapter Configuration Wizard welcome page appears.

  2. Click Next. The Service Name dialog box appears.

  3. Enter a name for the file adapter service for example ReadPO. You can add an optional description of the service.

  4. Click Next and the Operation dialog box appears.

    Specifying the Operation

    the picture is described in the document text

  5. Specify the operation type, for example Synchronous Read File. This automatically populates the Operation Name field.

    Click Next to access the File Directories dialog box.

  6. Select Physical Path radio button and enter the input payload file directory information. For example, enter /usr/tmp/ as the directory name.

    Uncheck the Delete Files after successful retrieval check box. Click Next to open the File Name dialog box.

  7. Enter the name of the file for the synchronous read file operation. For example, enter 'Input.xml'. Click Next. The Messages dialog box appears.

    Specifying Message Schema

    the picture is described in the document text

  8. Select Browse for schema file in Schema Location. The Type Chooser window is displayed.

    1. Click Import Schema Files button on the top right corner of the Type Chooser window.

    2. Enter the schema location for the service. Such as http://<myhost>:<port>/webservices/AppsWSProvider/oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService.xsd.

      Schema location for your service can be found from the service WSDL URL (for example, http://<myhost>:<port>/AppsWSProvider/oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService?wsdl).

      Importing Schema Location

      the picture is described in the document text

    3. Select the Add to Project check box and click OK.

    4. Click OK for Import schema prompt.

      The Imported Schemas folder is automatically added to the Type Chooser window.

    5. Select schema element by expanding the Imported Schemas folder > PurchaseOrderService.xsd > PurchaseOrderService_ApprovePurchaseOrder.

      Click OK.

      The selected schema location and element values are displayed.

      Viewing Selected Message Schema and Element

      the picture is described in the document text

  9. Click Next and then Finish. The wizard generates the WSDL file corresponding to the partner link. The main Create Partner Link dialog box appears, specifying the new WSDL file ReadPO.wsdl.

    Completing the Partner Link Configuration

    the picture is described in the document text

    Click Apply and then OK to complete the configuration and create the partner link with the required WSDL settings for the File Adapter Service.

    The ReadPO Partner Link appears in the BPEL process diagram.

    Adding the Partner Link for File Adapter

    the picture is described in the document text

Adding an Invoke activity

This step is to configure two Invoke activities:

  1. Point to the File Adapter ReadPO to synchronous read the purchase order from the Receive activity.

  2. Point to the PurchaseOrderService partner link to send the transaction information that is received from the Assign activities to initiate the single purchase order approval process.

To add an Invoke activity for ReadPO Partner Link:

  1. In JDeveloper BPEL Designer, drag and drop the Invoke activity from the Component Palette into the Activity box of the process diagram, between the Receive and Reply activities.

  2. Link the Invoke activity to the ReadPO service. The Invoke activity will send event data to the partner link. The Edit Invoke dialog box appears.

    Editing the Invoke Activity

    the picture is described in the document text

  3. Enter a name for the Invoke activity, and then click the Create icon next to the Input Variable field to create a new variable. The Create Variable dialog box appears.

    Creating a Variable

    the picture is described in the document text

  4. Select Global Variable and then enter a name for the variable. You can also accept the default name. Click OK.

  5. Enter a name for the Invoke activity and then click the Create icon next to the Output Variable field to create a new variable. The Create Variable dialog box appears.

  6. Select Global Variable and then enter a name for the variable. You can also accept the default name. Click OK.

  7. Click Apply and then OK in the Edit Invoke dialog box to finish configuring the Invoke activity.

    The Invoke activity appears in the process diagram.

    Adding an Invoke Activity

    the picture is described in the document text

To add an Invoke activity for PurchaseOrderService Partner Link:

  1. In JDeveloper BPEL Designer, drag and drop the Invoke activity from the Component Palette into the Activity box of the process diagram, after the Invoke and Reply activities.

  2. Link the Invoke activity to the PurchaseOrderService service. The Invoke activity will send event data to the partner link. The Edit Invoke dialog box appears.

  3. Enter a name for the Invoke activity such as 'InvokePOService'. Create input and output variables described in the first Invoke activity. Click OK to close the Create Variable dialog box.

  4. Click Apply and then OK to finish configuring the Invoke activity.

    The Invoke activity appears in the process diagram.

    Adding an Invoke Activity

    the picture is described in the document text

Adding an Assign activity

This step is to configure three Assign activities:

  1. To set the header details.

    Note: You need to populate certain variables in the BPEL process for ServiceBean_Header elements to pass values that may be required to embed application context into SOAP envelopes for Web service authorization. These ServiceBean_Header elements for Business Service Object interface type are RESPONSIBILITY_NAME, RESPONSIBILITY_APPL_NAME, SECURITY_GROUP_NAME, NLS_LANGUAGE, and ORG_ID.

    Detailed information on how to set ServiceBean_Header for the SOAP request, see Assigning ServiceBean_Header Parameters.

  2. To pass the purchase order details read from the File Adapter as an input to the second Invoke activity for PurchaseOrderService partner link.

  3. To pass single purchase order approval information to the requestor through the dummy Reply activity.

To add the first Assign activity to pass header details:

Assigning ServiceBean_Header Parameters:

  1. In JDeveloper BPEL Designer, drag and drop the Assign activity from the Component Palette into the Activity box of the process diagram, between the two Invoke activities.

  2. Double-click the Assign activity to access the Edit Assign dialog box.

  3. Click the General tab to enter the name for the Assign activity, such as 'SetServiceBeanHeader'.

  4. On the Copy Operation tab, click Create and then select Copy Operation from the menu. The Create Copy Operation window appears.

  5. Enter the first pair of parameters:

  6. Enter the second pair of parameters by selecting Copy Operation from the Create drop-down list with the following values:

  7. Enter the third pair of parameters:

  8. Enter the fourth pair of parameters:

  9. Enter the fifth pair of parameters by selecting Copy Operation from the Create drop-down list with the following values:

  10. The Edit Assign dialog box appears.

  11. Click Apply and then OK to complete the configuration of the Assign activity.

To enter the second Assign activity to pass PO details to the InvokePOService Invoke activity:

  1. In JDeveloper BPEL Designer, drag and drop the Assign activity from the Component Palette into the Activity box of the process diagram, between the Assign and Invoke activities.

  2. Double-click the Assign activity to access the Edit Assign dialog box.

  3. Click the General tab to enter the name for the Assign activity, such as 'SetPOApproval'.

  4. On the Copy Operation tab, click Create and then select Copy Operation from the menu. The Create Copy Operation window appears.

  5. Enter the following information:

  6. Click Apply and then OK to complete the configuration of the Assign activity.

To enter the third Assign activity to set the SOAP response to output:

  1. Add the second Assign activity by dragging and dropping the Assign activity from the Component Palette into the Activity box of the process diagram, between the InvokePOService Invoke and the Reply activities.

  2. Repeat Step 2 to Step 4 described in creating the first Assign activity to add the second Assign activity called 'SetPOStatus'.

  3. Enter the following information:

  4. Click Apply and then OK to complete the configuration of the Assign activity.

Deploying and Testing the BPEL Process at Run Time

After creating a BPEL process using the WSDL URL generated from the business service object interface definition, you can deploy it to a BPEL server if needed. To ensure that this process is modified or orchestrated appropriately, you can also manually test the BPEL process by initiating the business process contained in the BPEL process to test the interface integration.

Prerequisites

Before deploying the BPEL process using Oracle JDeveloper, you must ensure that you have established the connectivity between the deign-time environment and the run-time servers including the application server and the integration server.

How to configure the necessary server connection, see Configuring Server Connection.

To validate your BPEL process, perform the following run-time tasks:

  1. Deploy the BPEL process

    Once you deploy the process to a BPEL server, it becomes available so that you can run the process manually to test it for validation.

  2. Test the BPEL process

    After deploying a BPEL process, you can manage the process from the BPEL console to manually initiate the business process and test the interface integration contained in your BPEL process.

Deploying the BPEL Process

You must deploy the Approve Purchase Order BPEL process (POApprove.bpel) that you created earlier before you can run it.

To deploy the BPEL process:

  1. In the Applications Navigator of JDeveloper BPEL Designer, select the POApprove project.

  2. Right-click the project and click Make action from the menu.

    Look for any compilation error messages in Message Log.

    Right-click the project and select Deploy >Integration Server Connection name > Deploy to Default Domain action from the menu.

    For example, you can select Deploy > BPELServerConn > Deploy to Default Domain to deploy the process if you have the BPEL Process Manager setup appropriately.

    Deploying the BPEL Process

    the picture is described in the document text

  3. Look for ‘Build successful’ message in Apache Ant – Log to ensure that the BPEL project is compiled and successfully deployed.

Testing the BPEL Process

Once the BPEL process is deployed, it can be seen in the BPEL console. You can manage and monitor the process from the BPEL console. You can also test the process and the integration interface by logging on to Oracle E-Business Suite to manually initiate the processes.

To test the BPEL process:

  1. Log into Oracle Application Server 10g BPEL Console ( http://<soaSuiteServerHostName>:<port>/BPELConsole). The BPEL Console login page appears.

  2. Enter the username and password and click Login.

    The Oracle Enterprise Manager 10g BPEL Control appears.

  3. In the BPEL Console, confirm that 'POApprove' has been deployed.

  4. Click the ApprovePO link to open the Initiate tab

  5. Enter the payload input field and click Post XML Message to initiate the process.

  6. The audit trail provides information about the steps that have been executed. You can check the audit trail by clicking the Audit Instance icon.

    This is to verify that a purchase order is approved successfully.

Validating the Process in Oracle E-Business Suite

Additionally, you can validate the BPEL process in Oracle E-Business Suite. Log on to Oracle E-Business Suite with the Purchasing responsibility. Open up the Purchase Orders form and search for the supplier to bring up the purchase order details. Notice that the Status field is 'Approved'.