5 Understanding BPEL Integration with Service Components (BPEL/Mediator)

This chapter includes these sections:

5.1 Overview

To integrate with Oracle BPEL Process Manager, the organization's enterprise WSDL must be available to the user. The underlying adapter services are exposed as WSDL files, which are generated during design time in the configuration wizard of the Oracle RightNow adapter.

Use the generated WSDL files to design the appropriate BPEL processes for outbound adapter services. A completed BPEL process must be successfully compiled in JDeveloper and deployed to an SOA Suite server. Upon deployment to a SOA Suite server, each newly-deployed process is viewable in the Oracle Enterprise Manager Fusion Middleware Control, where you can run, monitor, administer BPEL processes, and monitor adapter events.

5.1.1 Understanding the Account Object

You create an Account object and integrate the WSDL with the Oracle BPEL Process Manager. Account is one of the standard objects provided by RightNow, an account generated for a staff member in the RightNow Cx system. Customer service representatives, sales agents, and site administrators use Accounts.

Specifically, an Account object on RightNow Cx represents an individual or business associated with the business.

The Oracle RightNow adapter enables you to create an Account object on RightNow Cx.

5.2 Configuring the CSF Key on Fusion Middleware Control Console

For steps to configure the CSF key in Oracle Enterprise Manager Fusion Middleware Control, seeSection A, "Credential Store Configuration for Managing RightNow Credentials."

5.3 Designing a Composite for Service Integration

The next steps detail how to design a composite using the Oracle JDeveloper Studio Edition, a comprehensive tool for developing Oracle Fusion Middleware applications. It provides an easy-to-use Integrated Development Environment that enables you to create your integrations efficiently.

5.3.1 Defining Composite for BPEL and Mediator

To define a composite for BPEL and Mediator:

  1. In the File menu of JDeveloper, click New and select Application.

    JDeveloper displays the New Gallery page. Select SOA Application from the Items list.

    Figure 5-2 Create SOA Application

    Description of Figure 5-2 follows
    Description of "Figure 5-2 Create SOA Application"

  2. Provide a suitable name to your application.

    Figure 5-3 Name Your Application

    Description of Figure 5-3 follows
    Description of "Figure 5-3 Name Your Application"

  3. Click Next and provide a suitable name to your project.

    Figure 5-4 Provide a Name for Your Project

    Description of Figure 5-4 follows
    Description of "Figure 5-4 Provide a Name for Your Project"

  4. Click Next.

  5. Select Composite With BPEL Process from the Standard Composite list.

    Figure 5-5 Configure SOA Settings

    Description of Figure 5-5 follows
    Description of "Figure 5-5 Configure SOA Settings "

  6. Click Finish.

  7. Select the Synchronous BPEL Process from the Template drop-down list and click OK.

    Figure 5-6 Create BPEL Process

    Description of Figure 5-6 follows
    Description of "Figure 5-6 Create BPEL Process "

    The composite.xml appears.

    Figure 5-7 composite.xml File

    Description of Figure 5-7 follows
    Description of "Figure 5-7 composite.xml File"

  8. In the Application Navigator, under the Schemas folder, Oracle JDeveloper displays an XML schema file with the name BPELProcess1.xsd after BPEL process creation.

  9. Edit this schema file as your business needs require. It is the responsibility of the front-end application to enforce data validations and to ensure that the input sent to the Oracle RightNow Cx Server from SOA is error-free.

    The structure of the schema used in this use case is as shown below.

    Figure 5-9 Edit XML Schema File

    Description of Figure 5-9 follows
    Description of "Figure 5-9 Edit XML Schema File"

5.4 Configuring the Oracle RightNow Adapter

To configure a new Oracle RightNow adapter:

  1. In the External References swimlane of the composite.xml file, right-click and select Oracle RightNow Adapter.

    Figure 5-10 Oracle RightNow Adapter with composite.xml File

    Description of Figure 5-10 follows
    Description of "Figure 5-10 Oracle RightNow Adapter with composite.xml File"

  2. Oracle JDeveloper displays the Basic Info screen.

  3. Enter a meaningful name and optional description.

  4. Click Next.

    Figure 5-11 Oracle RightNow Adapter Configuration Wizard Basic Info Screen

    Description of Figure 5-11 follows
    Description of "Figure 5-11 Oracle RightNow Adapter Configuration Wizard Basic Info Screen "

  5. JDeveloper displays the Connection page. You must provide the WSDL URL/location, security policy, and authentication key details.

    Figure 5-12 Oracle RightNow Adapter Configuration Wizard Connection Screen

    Description of Figure 5-12 follows
    Description of "Figure 5-12 Oracle RightNow Adapter Configuration Wizard Connection Screen"

  6. If you have the WSDL available in the file system, click the Find existing WSDLs icon, located to the right of the WSDL on the screen.

    JDeveloper displays the WSDL Chooser dialog. Browse and select the downloaded Enterprise WSDL and click OK.

  7. Click OK.

    Figure 5-13 Oracle RightNow Adapter Configuration Wizard

    Description of Figure 5-13 follows
    Description of "Figure 5-13 Oracle RightNow Adapter Configuration Wizard "

  8. Click OK. You are returned to the Connection page.

  9. As an alternative, you can store WSDL at an MDS location and access it. The next screenshot shows you storing the WSDL at an MDS location.

    Figure 5-14 Storing WSDL at an MDS Location

    Description of Figure 5-14 follows
    Description of "Figure 5-14 Storing WSDL at an MDS Location"

  10. Navigate to IDE Connections-> SOA-MDS. Select the appropriate SOA-MDS connection where you placed the Enterprise WSDL. Select the WSDL file to be used in the adapter configuration and click OK.

  11. Ensure that the WSDL is of the form:

    oramds:/apps/SOA/WSDLs/Integration/rightnowAPI.wsdl
    

    An alternative is to directly provide the https URL:

    https://integration-test.rightnowdemo.com/cgi-bin/integration_test.cfg/services/soap?wsdl
    
  12. Click OK.

  13. Click ”+” button to create a new Authentication Key.

  14. Provide a suitable name and the Right Now credentials and click OK.

  15. Click the Test button to validate the Authentication Key.

  16. Click Next.

    Oracle JDeveloper displays the Operations page.

  17. Figure 5-15 Oracle RightNow Adapter Operations Screen

    Description of Figure 5-15 follows
    Description of "Figure 5-15 Oracle RightNow Adapter Operations Screen"

  18. Because the requirement is to create an Account on RightNow, select the CRUD and Create options from the Select an Operation Type list.

    On the same screen, move Account from the list of Available objects to the list of the Selected objects.

  19. Click the Processing Options link in the upper right corner of the screen.

  20. Select the processing options for your requirement. Properties displayed in this page depend on the operation you selected in the previous page. In this case, the Suppress Response checkbox is selected, and suppressing a response is disabled, that is, made false. Once this is selected, the Create operation returns a valid ID for a a batch operation instance you are creating.

  21. Click Next. JDeveloper displays the Summary page, which provides a complete summary of the operation selected, the object on which the operation operates and the headers selected for that operation.

  22. Click Done to complete the Oracle RightNow adapter Configuration wizard.

    Figure 5-16 The Services, Components and External References Screen Showing the Adapter in External References Swimlane

    Description of Figure 5-16 follows
    Description of "Figure 5-16 The Services, Components and External References Screen Showing the Adapter in External References Swimlane"

5.5 Integrating with BPEL

Perform the following steps to provide integration with BPEL:

  1. Connect BPELProcess1 and ServiceCloudCreateAccount using a wire.

    Figure 5-17 BPELProcess1 and RightNowAccount External Reference Connected Through a Wire

    Description of Figure 5-17 follows
    Description of "Figure 5-17 BPELProcess1 and RightNowAccount External Reference Connected Through a Wire"

  2. After wiring your composite appears.

    Figure 5-18 Composite Application with Service, BPELProcess and Reference Wired

    Description of Figure 5-18 follows
    Description of "Figure 5-18 Composite Application with Service, BPELProcess and Reference Wired"

  3. Double-click and open BPELProcess1. The Oracle RightNow adapter should be present as a part of the Partner Links.

    Figure 5-19 Oracle RightNow Reference Adapter Shown as Part of Partner Links

    Description of Figure 5-19 follows
    Description of "Figure 5-19 Oracle RightNow Reference Adapter Shown as Part of Partner Links"

  4. Add an Invoke activity to invoke the ServiceCloudCreateAccount Partner Link. To add the Invoke activity:

    1. Drag and drop the invoke activity from the BPEL constructs.

    2. After dropping the Invoke property on the canvas, wire the Invoke activity to the ServiceCloudAdapter partner link.

  5. Create an input variable to the partner link by clicking the + button adjacent to Input text box in the Variables section. JDeveloper displays the Create Variable dialog.

    Figure 5-21 Create Variable Dialog to Create an Input Variable for the Partner Link

    Description of Figure 5-21 follows
    Description of "Figure 5-21 Create Variable Dialog to Create an Input Variable for the Partner Link"

  6. Create an output variable from the partner link by clicking the + button adjacent to Output text box in the Variables section. The wizard displays the Create Variable dialog.

    Figure 5-22 Create Variable Dialog to Create an Output Variable

    Description of Figure 5-22 follows
    Description of "Figure 5-22 Create Variable Dialog to Create an Output Variable"

  7. Introduce two transform activities, one before the Invoke activity and another after it.

    Figure 5-23 Two Transform Activities in Bpel Diagram

    Description of Figure 5-23 follows
    Description of "Figure 5-23 Two Transform Activities in Bpel Diagram"

  8. Map Transform1 values from receive activity's input variable to the Invoke activity's input variable.

    Figure 5-24 Mapping Transform1 Values from Receive Activity's Input Variable to Invoke Activity's Input Variable

    Description of Figure 5-24 follows
    Description of "Figure 5-24 Mapping Transform1 Values from Receive Activity's Input Variable to Invoke Activity's Input Variable"

  9. Click the + button adjacent to Mapper File text box to open the Transformation_1.xsl file.

  10. Map between inputVariable and Invoke1_create_InputVariable:

  11. Map Transform2 values from the Invoke activity's output variable to the reply activity's input variable.

    Figure 5-26 Mapping Transform2 values from Invoke Activity's Output Variable to Reply Activity's Input Variable

    Description of Figure 5-26 follows
    Description of "Figure 5-26 Mapping Transform2 values from Invoke Activity's Output Variable to Reply Activity's Input Variable"

  12. Map the output variable.

    Figure 5-27 Mappings for Output Variable

    Description of Figure 5-27 follows
    Description of "Figure 5-27 Mappings for Output Variable"

    This completes the project creation. JDeveloper displays the composite.xml.

5.6 Deploying the Composite

To deploy the composite application:

  1. In the Application Navigator pane, right-click Project1 and select Deploy Project1.

    Figure 5-29 Deploying the Project

    Description of Figure 5-29 follows
    Description of "Figure 5-29 Deploying the Project"

  2. Select the Deploy to Application Server option and follow the instructions. Using this option, you can deploy the composite on the Application server after providing the details of the server.

5.7 Testing the Composite

You can run and test the instances of deployed SOA composite applications from the Oracle Fusion Middleware Control Console. Doing so enables you to manage a composite application, initiate and track an instance of a composite and to view detailed component instance audit trails.

The following process shows you how to test the composite.

5.7.1 Testing the Outbound Process

To test the Outbound process:

  1. Login to Fusion Middleware Console for the server on which you have deployed your project.

  2. Open Project1 under the Default partition.

  3. Click the Test button to test the Web service.

  4. Provide the input payload and click the Test Web Service button.

    Figure 5-31 Testing the Web Service

    Description of Figure 5-31 follows
    Description of "Figure 5-31 Testing the Web Service"

    After successful execution, the response contains the id of the account created on RightNow and Status as success.

    Figure 5-32 Test Response Containing ID of the Account Created on RightNow Cx

    Description of Figure 5-32 follows
    Description of "Figure 5-32 Test Response Containing ID of the Account Created on RightNow Cx"