5 Understanding 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 Fusion Middleware Control console, 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 on the Fusion Middleware Control Console, seeAppendix 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 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 Template drop-down and click OK.

    The composite.xml appears.

  8. In the Application Navigator, under the Schemas folder, 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 Oracle RightNow Adapter

To configure a new Oracle RightNow adapter:

  1. In External References swim lane 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. JDeveloper displays the Oracle RightNow Adapter Configuration Wizard - Welcome page.

  3. Click Next.

    Figure 5-11 Oracle RightNow Adapter Configuration Wizard Welcome Screen

    Description of Figure 5-11 follows
    Description of ''Figure 5-11 Oracle RightNow Adapter Configuration Wizard Welcome Screen ''

  4. JDeveloper displays the Oracle RightNow Adapter Server Connection page. You must provide the WSDL URL/Location and Authentication Key details.

    Figure 5-12 Oracle RightNow Adapter Configuration Wizard Server Connection Screen

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

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

    Figure 5-13 Oracle RightNow Adapter Configuration Wizard WSDL Chooser Dialog

    Description of Figure 5-13 follows
    Description of ''Figure 5-13 Oracle RightNow Adapter Configuration Wizard WSDL Chooser Dialog''

  6. Click OK.

    Figure 5-14 Oracle RightNow Adapter Configuration Wizard

    Description of Figure 5-14 follows
    Description of ''Figure 5-14 Oracle RightNow Adapter Configuration Wizard ''

  7. Click OK. You are returned to the Oracle RightNow Adapter Server Connection page.

  8. 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-15 Storing WSDL at an MDS Location

    Description of Figure 5-15 follows
    Description of ''Figure 5-15 Storing WSDL at an MDS Location''

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

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

    Figure 5-16 Oracle RightNow Adapter Configuration Wizard Server Connection Showing WSDL

    Description of Figure 5-16 follows
    Description of ''Figure 5-16 Oracle RightNow Adapter Configuration Wizard Server Connection Showing WSDL''

  11. Click OK.

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

  13. JDeveloper displays the Add Credential dialog box. Provide a suitable name and the Right Now credentials and click OK.

    Figure 5-17 Oracle RightNow Adapter Configuration Wizard Add Credential Dialog

    Description of Figure 5-17 follows
    Description of ''Figure 5-17 Oracle RightNow Adapter Configuration Wizard Add Credential Dialog''

  14. Click Test Connection button to validate the Authentication Key.

    Figure 5-18 Oracle RightNow Adapter Configuration Wizard Server Connection Screen Showing Successful Test Connection

    Description of Figure 5-18 follows
    Description of ''Figure 5-18 Oracle RightNow Adapter Configuration Wizard Server Connection Screen Showing Successful Test Connection ''

  15. Click Next.

  16. JDeveloper displays the Cloud Operation Configuration page.

    Figure 5-19 Oracle RightNow Adapter Operation Configuration Showing Account Business Object Selected

    Description of Figure 5-19 follows
    Description of ''Figure 5-19 Oracle RightNow Adapter Operation Configuration Showing Account Business Object Selected''

  17. Because the requirement is to create an Account on RightNow, select the Operation Category as CRUD and Cloud Operation as create.

    On the same screen, move Account from the list of Available objects to the list of the Selected objects. The WSDL Operation by default is create. You can edit the WSDL Operation by providing an operation name suitable to your business requirement.

  18. Click Properties tab. JDeveloper displays the Oracle RightNow Adapter Processing Options page.

    Figure 5-20 Oracle RightNow Adapter Configuration Wizard Operation Options Screen with Suppress Response Option Selected

    Description of Figure 5-20 follows
    Description of ''Figure 5-20 Oracle RightNow Adapter Configuration Wizard Operation Options Screen with Suppress Response Option Selected''

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

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

  21. Figure 5-21 Oracle RightNow Adapter Configuration Wizard Finish Screen

    Description of Figure 5-21 follows
    Description of ''Figure 5-21 Oracle RightNow Adapter Configuration Wizard Finish Screen''

  22. Click the Finish button to complete the Oracle RightNow adapter Configuration wizard. After clicking on Finish button, the External References screen appears.

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

    Description of Figure 5-22 follows
    Description of ''Figure 5-22 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-23 BPELProcess1 and RightNowAccount External Reference Connected Through a Wire

    Description of Figure 5-23 follows
    Description of ''Figure 5-23 BPELProcess1 and RightNowAccount External Reference Connected Through a Wire''

  2. After wiring your composite appears.

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

    Description of Figure 5-24 follows
    Description of ''Figure 5-24 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-25 Oracle RightNow Reference Adapter Shown as Part of Partner Links

    Description of Figure 5-25 follows
    Description of ''Figure 5-25 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-27 Create Variable Dialog to Create an Input Variable for the Partner Link

    Description of Figure 5-27 follows
    Description of ''Figure 5-27 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-28 Create Variable Dialog to Create an Output Variable

    Description of Figure 5-28 follows
    Description of ''Figure 5-28 Create Variable Dialog to Create an Output Variable''

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

    Figure 5-29 Two Transform Activities in Bpel Diagram

    Description of Figure 5-29 follows
    Description of ''Figure 5-29 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-30 Mapping Transform1 Values from Receive Activity's Input Variable to Invoke Activity's Input Variable

    Description of Figure 5-30 follows
    Description of ''Figure 5-30 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-32 Mapping Transform2 values from Invoke Activity's Output Variable to Reply Activity's Input Variable

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

  12. Map the output variable.

    Figure 5-33 Mappings for Output Variable

    Description of Figure 5-33 follows
    Description of ''Figure 5-33 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-35 Deploying the Project

    Description of Figure 5-35 follows
    Description of ''Figure 5-35 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-37 Testing the Web Service

    Description of Figure 5-37 follows
    Description of ''Figure 5-37 Testing the Web Service''

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

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

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