Skip Headers
Oracle® Fusion Middleware Developer's Guide for Oracle Enterprise Scheduler
11g Release 1 (11.1.1.7)

Part Number E24713-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

11 Using the Oracle Enterprise Scheduler Web Service

This chapter describes how you can use the Oracle Enterprise Scheduler web service for accessing a subset of the Oracle Enterprise Scheduler runtime functionality.

This chapter includes the following sections:

11.1 Introduction to the Oracle Enterprise Scheduler Web Service

Oracle Enterprise Scheduler provides a rich set of functionality for enterprise level scheduling. This functionality includes support for the following operations:

Client applications can use the Oracle Enterprise Scheduler web service (ESSWebservice) to access a subset of the Oracle Enterprise Scheduler runtime functionality. The ESSWebservice is provided primarily to support SOA integration, for example invoking Oracle Enterprise Scheduler from a BPEL process. However, any client that needs a web service to interact with Oracle Enterprise Scheduler can use ESSWebservice. ESSWebservice exposes job scheduling and management functionality for request submission and request management.

ESSWebservice is deployed within the Oracle Enterprise Scheduler application, where the application is a Java EE application within the Oracle Enterprise Scheduler runtime framework. Thus, the ESSWebservice is available on every node where Oracle Enterprise Scheduler is installed and deployed.

The ESSWebservice is a synchronous web service, such that all the operations invoked are synchronous operations. Since internally, the job execution model in Oracle Enterprise Scheduler is asynchronous, the APIs themselves do not need to be asynchronous. However, Oracle Enterprise Scheduler web service also provides the capability to retrieve the job completion events asynchronously (in a manner similar to implementing the Oracle Enterprise Scheduler EventListener contract in the core API layer).

The ESSWebservice WSDL describes the complete functionality for the ESSWebservice. Table 11-1 summarizes the operations available with ESSWebservice.

Table 11-1 Summary of Operations Available with ESSWebservice

Operation Communication Type Description

addPPAction

Synchronous

Adds a post-processing action to a step in a job set request. This method is called prior to submitting the request. The method provides support for action previously supported by add_printer, add_notification, add_layout in concurrent processing. The parameters to these legacy routines are passed as arguments to addPPAction in the order in which they were declared in the original routine. For more information, see Section 11.8, "Using Additional ESSWebService Operations"

addPPActions

Synchronous

Similar to addPPAction, except that you can package multiple actions in your request.

cancelRequest

Synchronous

Cancels the processing of a request that is not in a terminal state.

deleteRequest

Synchronous

Marks a request in a terminal state for deletion. This does not physically remove any data, although the request will no longer be accessible by most methods.

For parent requests, this operation will cascade to all children.

getCompletionStatus

Asynchronous

Registers for an asynchronous status update when the request completes. A one-way operation with a separate asynchronous response.

getRequestDetail

Synchronous

Gets the runtime details of the specified request.

getRequestState

Synchronous

Retrieves the current state of the specified request.

holdRequest

Synchronous

Withholds further processing of a request that is in WAIT or READY state. For parent requests, this operation will cascade to all eligible child requests.

releaseRequest

Synchronous

Releases a request from the HOLD state. For parent requests, this operation will cascade to all eligible child requests.

setAsyncRequestStatus

Synchronous

Sets the status of an asynchronous java job.

setNLSOptions

Synchronous

Sets NLS environment options for a request.

setStepsArgs

Synchronous

Marshals arguments in the previous concurrent processing style into a Oracle Enterprise Scheduler properties for a step in a job set request. This operation is invoked prior to submitting a request. For more information, see Section 11.8, "Using Additional ESSWebService Operations".

setSubmitArgs

Synchronous

Marshals arguments in the previous concurrent processing style into Oracle Enterprise Scheduler properties.This operation is invoked prior to submitting the request. The key of each argument is ARGUMENT_PREFIX#, where # is the ordinal value of the argument. For example ARGUMENT_PREFIX1="firstArg" and ARGUMENT_PREFIX2="secondArg". For more information, see Section 11.8, "Using Additional ESSWebService Operations".

submitRecurringRequest

Synchronous

Submits a new recurring job request (a request with a schedule). For more information, see Section 11.8, "Using Additional ESSWebService Operations".

submitRequest

Synchronous

Submits a new job request. For more information, see Section 11.4, "Use Case Using Oracle Enterprise Scheduler ESSWebservice from a BPEL Process"


11.2 Developing and Using ESSWebservice Applications

Oracle Enterprise Scheduler executes a job request, for example a Java type job request, in the context of the application that submitted the job. Typically, for development purposes, Oracle Enterprise Scheduler and client applications co-exist locally on any given node which allows Oracle Enterprise Scheduler to execute the job in the context of the target application. For the purposes of production, the client application and Oracle Enterprise Scheduler often reside on different servers.

A Java EE application that uses Oracle Enterprise Scheduler contains all the Oracle Enterprise Scheduler artifacts including the following:

Any clients interacting with Oracle Enterprise Scheduler using ESSWebservice need to provide such a Java EE application, such that Oracle Enterprise Scheduler can run jobs in the context of the correct target application. All such web service clients must know the name of the corresponding Java EE hosting application and should pass it to Oracle Enterprise Scheduler using the web service call wherever required (where this is required is defined in the WSDL).

The details for developing this hosting application are described in Chapter 5, "Use Case Oracle Enterprise Scheduler Sample Application (Deprecated)." Such an application is a regular Oracle Enterprise Scheduler client application, but the job request submission and other Oracle Enterprise Scheduler interactions may be skipped, as these calls are generated through the ESSWebservice.

11.2.1 How to Develop and Use an ESSWebservice Java EE Application

When the Oracle Enterprise Scheduler functionality is accessed using the ESSWebservice web service, a corresponding hosting Java EE application needs to be available to Oracle Enterprise Scheduler. Even though clients can interact with Oracle Enterprise Scheduler remotely using the Oracle Enterprise Scheduler web service, the associated Java EE application must still be co-located with Oracle Enterprise Scheduler. This allows Oracle Enterprise Scheduler to execute job requests in the correct application context. Therefore ESSWebservice clients still need to develop, package and deploy a corresponding Java EE application that contains all the required Oracle Enterprise Scheduler artifacts. For information about developing an Oracle Enterprise Scheduler application, see Chapter 5, "Use Case Oracle Enterprise Scheduler Sample Application (Deprecated)."

11.2.2 How to Develop and Use an ESSWebservice SOA Application with BPEL

For SOA clients all the SOA components such as a BPEL processor are deployed as a SOA composite. A SOA composite is not a Java EE application. The composite is executed using the SOA fabric runtime framework (within soa-infra).

For SOA components, create a separate Java EE hosting application that acts as the proxy between the composite and Oracle Enterprise Scheduler. This hosting application can either be created in a one-to-one association with one Oracle Enterprise Scheduler application for each composite deployed, or multiple composites can share a single Java EE hosting application. The Java EE hosting application contains all the desired Oracle Enterprise Scheduler artifacts.

11.2.3 Setting Web Service Addressing Headers for getCompletionStatus() Operation

As shown in the ESSWebservice WSDL, if clients want to be notified asynchronously on job completion they can invoke the getCompletionStatus() operation. Upon job completion, Oracle Enterprise Scheduler will invoke the callback operation onJobCompletion() following ws-addressing where ESSWebservice captures the caller's address in the incoming call. Clients should be capable of receiving the callback at any arbitrary time in future. Such a callback depends entirely upon the time required to complete the job. This is similar to the Oracle Enterprise Scheduler functionality for invoking a client's listener (that implements Oracle Enterprise Scheduler EventListener contract) upon job completion.

When you use getCompletionStatus() clients must include certain required web service addressing headers (in particular the wsa:MessageID and wsa:ReplyTo headers). This allows the Oracle Enterprise Scheduler runtime to asynchronously notify the job completion status be sent to the correct ReplyTo address. When you use getCompletionStatus() from a BPEL process the SOA runtime automatically adds the required headers. When using getCompletionStatus() programmatically on the client side, using the web service proxies, then the web service client must set these addressing headers.

11.2.4 Limitations for ESSWebservice

ESSWebservice does not support the following Oracle Enterprise Scheduler features:

  • Ad hoc Request Submission: ESSWebservice does not support ad hoc job request submission (ad hoc request submission is available using the EJB APIs). Therefore any job that is submitted using the ESSWebservice must have its corresponding definition, including a job type and job definition along with the schedule definitions created as metadata objects in the associated proxy application. The web service operation can then refer to such metadata objects using their identifier arguments as specified in the WSDL.

  • Query API: ESSWebservice does not expose the query APIs. Web service clients do not need to obtain the query information for Oracle Enterprise Scheduler requests. ESSWebservice web service clients do not provide generic monitoring and managing functionality that would require the use of query APIs.

11.2.5 ESSWebservice Implementation

The Oracle Enterprise Scheduler functionality is exposed as web service using an interface (SEI) annotated with the JAX-WS annotations. The implementation of this (SEI) web service invokes the common Oracle Enterprise Scheduler implementation layer. The ESSWebservice is exposed in Document/Literal/Wrapped mode for maximum interoperability.

Some of the data types used in ESSWebservice are not suitable to be used in web service directly. Such data types cannot be readily converted into corresponding XML representation. Therefore the Oracle Enterprise Scheduler web service layer defines wrapper classes around these data types that are exposed in the ESSWebservice, and visible in the WSDL. Otherwise in general, the web service layer reuses the existing data types where possible.

11.3 ESSWebservice WSDL File

When Oracle Enterprise Scheduler is installed and running, you can obtain the WSDL definition file from the web services page at the following type of URL:

http://host:port/ess/esswebservice?WSDL

For example,

http://system1:7001/ess/esswebservice?WSDL

Note that it is not supported to invoke web service operations by directly accessing the esswebservice URL from a browser.

11.4 Use Case Using Oracle Enterprise Scheduler ESSWebservice from a BPEL Process

The following sections show use of ESSWebService from a BPEL process; in the BPEL process you use ESSWebService to submit a job request. The use case demonstrates one path for using Oracle Enterprise Scheduler for BPEL and SOA users. Experienced SOA users and designers may have other ideas for how work with Oracle Enterprise Scheduler using the web service. To submit an Oracle Enterprise Scheduler job request from a BPEL process, you need to deploy an application that provides the required Oracle Enterprise Scheduler artifacts. For this use case you can deploy the EssDemoApp described in Chapter 5, "Use Case Oracle Enterprise Scheduler Sample Application (Deprecated)."

11.5 Creating the ESSWebService Application and a SOA Project

Using Oracle JDeveloper you create an application and the projects within the application that contain the code and support files for the application. To create the ESSWebService sample application, you do the following:

11.5.1 How to Create the ESSWebService Application and Project

To work with Oracle Enterprise Scheduler you first create an application and an SOA project in Oracle JDeveloper.

To create EssWebApplication:

  1. Click the New... icon.

  2. In the New Gallery, in the navigator, expand General and select Applications.

  3. In the Items area select SOA Application.

  4. Click OK.

  5. Use the Name your application window to enter the name and location for the new application and to specify the application template.

    1. In the Application Name field, enter an application name. For this sample application, enter EssWebApplication.

    2. In the Directory field, accept the default.

    3. Enter an application package prefix or accept the default, no prefix.

      The prefix, followed by a period, applies to objects created in the initial project of an application.

    4. Click Next.

  6. In the Name your project dialog select SOA project options.

    1. In the Project Name field, enter a project name or accept the default, Project1.

    2. On the Project Technologies tab, the Selected shuttle should show SOA.

    3. Click Finish. This creates the EssWebApplication that contains an SOA project.

11.6 Creating the ESSWebService Reference

In the SOA composite application you need to add the ESSWebservice reference to make the web service available for a partner link in the SOA composite application.

11.6.1 How to Add the ESSWebService Partner Link

You need to add the ESSWebService partner link to the SOA composite application.

To add the Oracle Enterprise Scheduler web service as a partner link:

  1. In the Application Navigator open the ESSWebApplication and expand Project1 and then expand SOA Content.

  2. In the Application Navigator select composite.xml.

  3. Right-click and from the dropdown list select Open. This displays the composite as shown in Figure 11-1.

    Figure 11-1 EssWebService Application composite.xml

    Description of Figure 11-1 follows
    Description of "Figure 11-1 EssWebService Application composite.xml"

  4. In the Component Palette from the SOA dropdown list, in the Service Adapters area select Web Service.

  5. Drag-and-drop the web service icon to the External References lane in composite.xml. This displays the Create Web Service window, as shown in Figure 11-2.

    Figure 11-2 Create Web Service Dialog

    Description of Figure 11-2 follows
    Description of "Figure 11-2 Create Web Service Dialog"

  6. In the Name field, enter a service name, or accept the default name.

  7. In the Type field, from the dropdown list select Reference.

  8. In the WSDL URL text field enter the value for the WSDL URL manually, for example:

    http://host:port/ess/esswebservice?WSDL
    
  9. In the SOA Resource Lookup dialog, click OK.

  10. In the Create Web Service dialog, in the Port Type field, from the dropdown list select ESSWebService.

  11. In the Create Web Service dialog, in the Callback Port Type select ESSWebServiceCallback from the dropdown list,

    Select the check box Copy WSDL and its dependent artifacts into the project. This allows the local copy of the Oracle Enterprise Scheduler abstract WSDL and ESSTypes.xsd files to be moved into the SOA composite project.

    Note:

    Keeping a local copy of a WSDL file may result in synchronization issues if the remote WSDL file is updated. Making a local copy of the remote WSDL file is therefore not recommended. However, doing so may be useful for certain scenarios such as offline designing.

  12. Click OK. Now the External References lane in composite.xml displays the new web service, as shown in Figure 11-3.

    Figure 11-3 Composite.xml with ESSWebService External Reference

    Composite.xml with ESSWebService external reference
    Description of "Figure 11-3 Composite.xml with ESSWebService External Reference"

11.7 Adding the BPEL Process to Call the ESSWebService

Now you need to add a BPEL Process to call the ESSWebService operations.

11.7.1 How to Add a BPEL Process to Call the ESSWebService

You need to add a BPEL process to use the ESSWebService.

To add a BPEL process to use the ESSWebService:

  1. In the Application Navigator, in Project1 select composite.xml.

  2. In the Component Palette, from the SOA dropdown list in the Service Components area select BPEL Process.

  3. Drag-and-drop a BPEL process to the components swim lane. This displays the Create BPEL Process dialog, as shown in Figure 11-4.

    Figure 11-4 Create BPEL Process Dialog for New BPEL Process

    Description of Figure 11-4 follows
    Description of "Figure 11-4 Create BPEL Process Dialog for New BPEL Process"

  4. Click OK. This adds the BPEL process to composite.xml, as shown in Figure 11-5.

    Figure 11-5 Adding a BPEL Process to the SOA Composite Application

    Adding a BPEL process to the SOA composite application
    Description of "Figure 11-5 Adding a BPEL Process to the SOA Composite Application"

  5. In composite.xml, select BPELProcess1 and then select and drag the right arrow to create a reference to Service1, as shown in Figure 11-6.

    Figure 11-6 Adding A Reference to the Oracle Enterprise Scheduler Web Service in composite.xml

    Adding a reference to the ESS web service in composite.xml
    Description of "Figure 11-6 Adding A Reference to the Oracle Enterprise Scheduler Web Service in composite.xml"

  6. Click the Save All icon to save the project files.

11.7.2 Copy Types Into BPEL Process Schema

You need to change the schema of the BPEL process by opening up the corresponding XSD file in the xsd folder under the project. This step is a shortcut for the demonstration purposes for this sample application. In your own application, you would use the schema types required for the ESSWebservice operations. This allows the clients of the BPEL process, for this example a simplified test case, to provide all the necessary inputs (this is required because clients are based on BPEL process schema). This step allows you to map, or assign inputs for the web service. This step is only required to correctly generate the sample application. In real scenarios the BPEL process designer is responsible for defining or supplying the input schema, and mapping this to the web service inputs.

Note:

The steps outlined require manual changes, depending on the BPEL process you are working with and the particular naming you are using for your BPEL process. You can find the types that are required for ESSWebService operations in the ESSWebService WSDL file. It is also possible to individually add these types to the schema.

To update the BPEL process schema:

  1. In the Application Navigator, in Project1 expand the SOA Content folder and expand the xsd folder.

  2. In the xsd folder, double-click the BPELProcess1.xsd file.

  3. Select the Source tab.

  4. Copy the EssWebService types so that the schema includes the contents shown in Example 11-1.

    The ESSTypes.xsd file and other WSDL artifacts exposed by the Oracle Enterprise Scheduler web service are imported into the composite and renamed esswebservice_XSD_<XSD file name>.xsd.

    Note:

    The schema shown in Example 11-1 includes the application and project name. If you change the application name or the project name for this example, you also need to update the schema targetNamespace and xmlns:tns elements to reflect the names that you use.

  5. In the BPELProcess1.xsd file, refer to the artifacts created in Section 11.6, "Creating the ESSWebService Reference" that have been imported into the composite. The directory path should be relative the BPELProcess1.xsd file. Example 11-1 shows the composite schema file with a reference to the web service artifacts.

    Example 11-1 BPEL XSD Schema

    <?xml version="1.0" encoding="UTF-8"?>
    <schema attributeFormDefault="unqualified" elementFormDefault="qualified"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"
            xmlns:ns1="http://xmlns.oracle.com/scheduler/types"
            targetNamespace="http://xmlns.oracle.com/
                             EssWebApplication/Project1/BPELProcess1"
            xmlns:tns="http://xmlns.oracle.com/
                       EssWebApplication/Project1/BPELProcess1"
            xmlns="http://www.w3.org/2001/XMLSchema">
    
    <import namespace="http://xmlns.oracle.com/scheduler/types"
      schemaLocation="../esswebservice_XSD_ESSTypes.xsd" />
    
      <element name="process">
        <complexType>
          <xs:sequence>
            <xs:element name="description" type="xs:string"/>
            <xs:element name="jobDefinitionId" type="ns1:metadataObjectId"/>
            <xs:element name="requestedStartTime" type="xs:dateTime"/>
            <xs:element name="application" type="xs:string"/>
            <xs:element name="requestParameters" type="ns1:requestParameters"/>
          </xs:sequence>
        </complexType>
      </element>
      <element name="processResponse">
        <complexType>
          <sequence>
            <element name="result" type="string"/>
            <element name="requestId" type="long"/>
            <element name="state" type="ns1:state"/>
          </sequence>
        </complexType>
      </element>
    </schema>
    
  6. Click the Save icon.

11.7.3 How to Invoke the ESSWebService submitRequest Operation

In the BPEL process you add an invoke activity to perform the Oracle Enterprise Scheduler web service submitRequest() operation. In this step you need to select the input and output for the Invoke Activity by associating values with the Input and Output variables.

To add the Invoke activity to submit the request using ESSWebService:

  1. In the Application Navigator, in Project1 expand SOA Content and select the BPEL file. For example, select BPELProcess1.bpel. This displays the BPEL swim lane as shown in Figure 11-7.

    Figure 11-7 BPEL Process Before Adding Invoke Activity for ESSWebService SubmitRequest

    BPEL process before adding an invoke activity
    Description of "Figure 11-7 BPEL Process Before Adding Invoke Activity for ESSWebService SubmitRequest"

  2. From the Component Palette, drag-and-drop an Invoke Activity and place the activity before callbackClient.

  3. Link the invoke activity to the ESSWebService by selecting the right arrow and dragging it to the Partner Link Service1. This brings up the Edit Invoke dialog, as shown in Figure 11-8.

    Figure 11-8 Edit Invoke Dialog for BPEL Activity

    Edit Invoke dialog for BPEL activity
    Description of "Figure 11-8 Edit Invoke Dialog for BPEL Activity"

  4. In the Edit Invoke dialog, in the Operation field, select submitRequest.

  5. In the Variables field, click the Add icon next to the Input field.

    The Create Variable dialog displays. Accept the default value and click OK.

  6. In the Edit Invoke dialog, click the Add icon next to the Output field.

    The Create Variable dialog displays. Accept the default value and click OK.

    The new invoke link to Service1 displays.

  7. Select the Invoke activity and double-click the name Invoke_1 to select the text entry field. In the text entry field enter submitRequest, as shown in Figure 11-9.

    Figure 11-9 Adding the submitRequest Invoke Activity

    Adding the submitRequest invoke activity.
    Description of "Figure 11-9 Adding the submitRequest Invoke Activity"

11.7.4 Assign Required Input Parameters for Request Submission

You add an Assign activity and then assign inputs from the BPEL process to the submitRequest Invoke activity.

Note:

In most cases, the input payload of the BPEL process will not directly match the input payload of the submit Request web service. Coaxing into use of CopyList will only work in the scenarios where there is a one to one mapping of the input payload to the submit Request.

For the mapping for an Assign activity with a Copy operation, the arguments correspond to the input parameters for Oracle Enterprise Scheduler submitRequest, as shown in Table 11-2. If your BPEL schema differs from the submitRequest message type, use Table 11-2 as a guide for how to populate the values manually with the Assign activity Copy operation.

Table 11-2 Submit Request Web Service Arguments for BPEL Assign Activity Mapping

Argument Description

Description

Context for the ad hoc submission of this job, such as the 'Order Import'.

Application

The application name can be the deployment name of the hosting Oracle Enterprise Scheduler application or it can be a logical application name.

JobDefinitionId

  • name: The name of the Oracle Enterprise Scheduler job

  • package: The name of the path containing the Oracle Enterprise Scheduler job

  • type: 'JOB_DEFINITION'

parameter(s)

dataType: Value type for this parameter (STRING, INTEGER, LONG, BOOLEAN, DATETIME)

name: String containing the name of the parameter defined in the Oracle Enterprise Scheduler job definition.

scope: String containing the named scope for this parameter - used only for job sets.

value: Element containing the parameter's value


To add an assign activity:

  1. Drag-and-drop an Assign activity from the BPEL Activities area in the Component Palette to just before the Invoke Activity named submitRequest.

  2. Select the Assign activity and double-click the name Assign_1 to enter new text. In the text entry box enter Job_Inputs, as shown in Figure 11-10.

    Figure 11-10 Adding an Assign Activity to BPEL

    Adding an Assign activity to BPEL
    Description of "Figure 11-10 Adding an Assign Activity to BPEL"

Add Copy for description JobDefinitionID requestedStartTime application:

  1. Double click the new Assign activity named Job_Inputs to show the Assign page with the Copy Operation tab, as shown in Figure 11-11.

    Figure 11-11 Copy Operation for BPEL Assign Activity

    Copy operation for BPEL assign activity
    Description of "Figure 11-11 Copy Operation for BPEL Assign Activity"

  2. Click the Add icon and from the dropdown list select Copy Operation, to add copy operations for variables. This displays the Create Copy Operation dialog.

  3. In the Create Copy Operation dialog, expand and then navigate to select a copy operation for each input parameter (you only use a copy operation for description, jobDefinitionID, requestedStartTime, and application). This copies the input parameters to Invoke_1_submitRequest_InputVariable parameters for the invoke activity. Figure 11-12 shows one of these copy operations.

    Figure 11-12 Copy Operation for Description Parameter for submitRequest

    Copy operation for the description parameter
    Description of "Figure 11-12 Copy Operation for Description Parameter for submitRequest"

  4. Click OK to add the copy operation for description.

  5. In a similar manner, perform additional copy operations for the jobDefintionID, requestedStartTime, and application parameters.

To add a copy list for RequestParameters:

  1. Double click the Assign activity named Job_Inputs to show the Assign page with the Copy Operation tab.

  2. Click the Add icon and from the dropdown list select CopyList Operation..., to add CopyList operations for the requestParameters. This displays the Create CopyList Operation dialog.

  3. In the Create CopyList Operation dialog, expand and then navigate to select a copylist operation for requestParameters. To do this you navigate and select the parameter element, as shown in Figure 11-13.

    Figure 11-13 CopyList Operation for Request Parameters

    CopyList operation for request parameters
    Description of "Figure 11-13 CopyList Operation for Request Parameters"

  4. In the Create CopyList Operation dialog, click OK.

  5. In the Assign activity, click OK.

Figure 11-14 shows the BPEL Design page.

Figure 11-14 BPEL with Job_Inputs Add Activity and submitRequest Invoke

BPEL with Job_Inputs Add activity and submitRequest Invoke
Description of "Figure 11-14 BPEL with Job_Inputs Add Activity and submitRequest Invoke"

When BPEL Element Does Not Have Same Type as Oracle Enterprise Scheduler web service:

If your BPEL payload is not the same element type as that of the Oracle Enterprise Scheduler web service and you need to assign values to one or more job parameters, you can use the following approach.

  1. Populate the first parameter element using copy operations, as done in previous steps.

  2. Add or clone additional parameter elements using the Insert-After, as shown in Figure 11-15.

    Figure 11-15 Using Insert-After to Clone Parameters

    Using Insert-After to clone parameters
    Description of "Figure 11-15 Using Insert-After to Clone Parameters"

  3. Populate the additional parameter elements using XPath array subscripting.

  4. This action effectively copies the entire parameter element along with all sub-element values and appends it to the end of the XML array. In order to populate the values of the second job parameter, add additional copy operations and modify the XPath expressions in the bottom right of the dialog to add the appropriate array subscript [n]. where 'n' is the # of the parameter. Note that all XML arrays start with 1, not 0.

11.7.5 Invoke the getCompletionStatus Operation

Add another Invoke activity and link it to Service1 to invoke the ESSWebService getCompletionStatus operation.

To add the Invoke activity for the getCompletionStatus operation:

  1. From the Component Palette, drag-and-drop an Invoke activity and drop it after submitRequest and before callbackClient.

  2. In the new Invoke activity, select the text entry area with the name Invoke_1, and enter the name, getStatusAsync.

  3. Link the invoke activity to Service1 by selecting the right arrow and dragging it to the Partner Link Service1. This displays the Edit Invoke dialog.

  4. In the Edit Invoke dialog for getStatusAsync, in the Operation field, from the dropdown list select getCompletionStatus.

  5. In the Input Variable field select the Add icon. This displays the create variable dialog, as shown in Figure 11-16.

    Figure 11-16 Create Variable Window for getStatusAsync

    Create Variable window for getStatusAsync
    Description of "Figure 11-16 Create Variable Window for getStatusAsync"

  6. In the Create Variable dialog, click OK. This displays the Edit Invoke dialog, as shown in Figure 11-17.

    Figure 11-17 Edit Invoke Window for getStatusAsync

    Edit Invoke window for getStatusAsync
    Description of "Figure 11-17 Edit Invoke Window for getStatusAsync"

  7. In the Edit Invoke dialog, click OK. This displays the new Invoke Activity getStatusAsync and the link to Service1.

11.7.6 Assign Input to the getCompletionStatus Operation

Add a new Assign Activity after submitRequest to assign the RequestID and pass it to the getStatusAsync invoke activity.

To add the assign activity:

  1. Drag-and-drop an Assign activity from the BPEL Activities area in the Component Palette to just after the Invoke Activity named submitRequest and before the Invoke Activity named getStatusAsync.

  2. Select the Assign activity and double-click the name Assign_1 to select the text entry area. In the text entry area, enter RequestID. Figure 11-18 shows the Assign activity.

    Figure 11-18 Adding RequestID Assign Activity

    Adding a RequestID Assign activity
    Description of "Figure 11-18 Adding RequestID Assign Activity"

  3. Double click the new Assign activity, RequestID to show the Assign page with the Copy Operation tab.

  4. Click the Add icon and select Copy Operation... from the dropdown list.

  5. In the From area expand Invoke_1_submitRequest_OutputVariable and select requestID. Map this in the To area to the requestID in getStatusAsync_getCompletionStatus_InputVariable, as shown in Figure 11-19.

    Figure 11-19 Edit Copy Operation Window for Request ID Assign

    Edit Copy Operation window for Request ID Assign
    Description of "Figure 11-19 Edit Copy Operation Window for Request ID Assign"

  6. On the Edit Copy Operation dialog, click OK.

  7. On the Copy Operation dialog, click OK.

  8. On the BPEL Design page, click Validate Process. This displays the BPEL, as shown in Figure 11-20.

    Figure 11-20 BPEL with Request ID Assign Activity Added

    BPEL with Request ID Assign activity added
    Description of "Figure 11-20 BPEL with Request ID Assign Activity Added"

11.7.7 Receive the Job Completion Status

Add a Receive Activity and link it to the onJobCompletion ESSWEbService operation.

Add a receive activity:

  1. Drag-and-drop a Receive activity from the BPEL Activities area in the Component Palette to a position after the getStatusAsync Invoke activity and before the callbackClient.

  2. Select the text entry area in the Receive Activity named Receive_1 and enter onJobCompletion, as shown in Figure 11-21.

    Figure 11-21 Adding Receive Activity to BPEL Process

    Adding a Receive activity to the BPEL process
    Description of "Figure 11-21 Adding Receive Activity to BPEL Process"

  3. Drag the right arrow from the receive activity onJobCompletion to Service 1. This displays the Edit Receive dialog, as shown in Figure 11-22.

    Figure 11-22 Edit Receive Window for onJobCompletion Receive Activity

    Edit Receive window for onJobCompletion Receive activity
    Description of "Figure 11-22 Edit Receive Window for onJobCompletion Receive Activity"

  4. In the Edit Receive dialog, in the Operation field from the dropdown list select onJobCompletion.

  5. In the Variable field, click the Add icon. This displays the Create Variable dialog.

  6. In the Create Variable dialog, click OK.

  7. In the Edit Receive dialog, click OK. This adds an arrow from Service1 to the new Receive activity, onJobCompletion as shown in Figure 11-23.

    Figure 11-23 Adding the onJobCompletion Receive Activity

    Adding the onJobCompletion Receive activity
    Description of "Figure 11-23 Adding the onJobCompletion Receive Activity"

11.7.8 Return Result to Client

Add an Assign activity to copy the result output from onJobCompletion to the output for the client. Assign all the results from onJobCompletion to the callbackClient input variable.

To add the result assign activity:

  1. Drag-and-drop an Assign activity from the BPEL Activities area in the Component Palette to a position after the Receive activity onJobCompletion and before the callbackClient.

  2. Select the Assign activity and double-click the name Assign_1 to enter new text. Enter the value Result, as shown in Figure 11-24.

    Figure 11-24 Adding Assign Activity for Output to Client

    Adding an Assign activity for output to the client
    Description of "Figure 11-24 Adding Assign Activity for Output to Client"

  3. Double click the new Result Assign activity to show the Assign page with the Copy Operation tab.

  4. Click the Add icon and select Copy Operation... from the dropdown list.

  5. Navigate to select the variables, for the From area for onJobCompletion_onJobCompletion_InputVariable and select resultMessage. In the To area, expand outputVariable and select client:result, shown in Figure 11-25.

    Figure 11-25 Create Copy Operation for Result

    Create copy operation for the result
    Description of "Figure 11-25 Create Copy Operation for Result"

  6. In the Create Copy Operation dialog, click OK.

  7. In the Assign area, click OK.

  8. Click Validate Process.

The final BPEL is shown in Figure 11-26.

Figure 11-26 Result Assign Activity with callbackClient Invoke Activity

Result Assign activity with callbackClient Invoke activity
Description of "Figure 11-26 Result Assign Activity with callbackClient Invoke Activity"

11.8 Using Additional ESSWebService Operations

You can use other EssWebService operations, including:

11.8.1 How to Invoke the ESSWebService submitRecurringRequest Operation

In the BPEL process you add an invoke activity to perform the Oracle Enterprise Scheduler web service submitRecurringRequest() operation. In this step you need to select the input and output for the Invoke Activity by associating values with the Input and Output variables. In order to submit jobs that repeat or will run at a later date that job must be submitted with an Oracle Enterprise Scheduler schedule which is constructed declaratively and stored in the metadata repository. Once the schedule has been defined, BPEL can submit jobs with that schedule through the submitRecurringRequest() operation.

To add the Invoke activity to submit the request using ESSWebService:

  1. In the Application Navigator, in Project1 expand SOA Content and select the BPEL file. For example, select BPELProcess1.bpel. This displays the BPEL swim lane.

  2. From the Component Palette, drag-and-drop an Invoke Activity and place the activity in the process. This activity populates the request submission payload and submits it to the Oracle Enterprise Scheduler web service.

  3. Select the Invoke activity and double-click the name Invoke_1 to select the text entry field. In the text entry field enter submitRecurringRequest.

  4. Link the invoke activity to the ESSWebService by selecting the right arrow and dragging it to the Partner Link Service1. This brings up the Edit Invoke dialog, as shown in Figure 11-27.

    Figure 11-27 Edit Invoke Window for BPEL Activity

    Edit Invoke window for BPEL activity
    Description of "Figure 11-27 Edit Invoke Window for BPEL Activity"

  5. In the Edit Invoke dialog, in the Operation field, select submitRecurringRequest.

  6. In the Edit Invoke dialog, in the Input field click the Add icon. This displays the Create Variable dialog and lets you create a scope-level variable to contain the request payload.

  7. In the Create Variable dialog, click OK.

  8. In the Edit Invoke dialog, in the Output field select the Add icon. This displays the Create Variable dialog and lets you create a scope-level variable to contain the response payload.

  9. In the Create Variable dialog, click OK.

  10. In the Edit Invoke dialog, click OK. This displays the new invoke link to Service1, as shown in Figure 11-28.

Figure 11-28 Submitting a Request with a Schedule

Submitting a request with a schedule
Description of "Figure 11-28 Submitting a Request with a Schedule"

To assign inputs for recurring request submission:

You add an Assign activity and then assign inputs from the BPEL process to the submitRecurringRequest Invoke activity. This allows you to populate the input variable with recurring request submission parameters.

Note:

In most cases, the input payload of the BPEL process will not directly match the input payload of the submit recurring request web service. Coaxing into use of CopyList will only work in the scenarios where there is a one to one mapping of the input payload to the submit Request.

For the mapping for an Assign activity with a Copy operation, the arguments correspond to the input parameters for Oracle Enterprise Scheduler submitRequest, as shown in Table 11-3. If your BPEL schema differs from the submitRequest message type, use Table 11-3 as a guide for how to populate the values manually with the Assign activity Copy operation.

Table 11-3 Submit Recurring Request Web Service Arguments for BPEL Assign Activity Mapping

Argument Description

Description

Context for the ad hoc submission of this job, such as the 'Order Import'.

Application

The "application" name can be the deployment name of the hosting Oracle Enterprise Scheduler application or it can be a logical application name.

JobDefinitionId

  • name: The name of the Oracle Enterprise Scheduler job

  • package: The name of the path containing the Oracle Enterprise Scheduler job

  • type: 'JOB_DEFINITION'

parameter(s)

dataType: Value type for this parameter (STRING, INTEGER, LONG, BOOLEAN, DATETIME)

name: String containing the name of the parameter defined in the Oracle Enterprise Scheduler job definition.

scope: String containing the named scope for this parameter - used only for job sets.

value: Element containing the parameter's value

scheduleID

  • name: String containing the name of the schedule metadata file

  • packageName: String containing the name of the MDS package containing the metadata file (sans the 'Schedule' path)

  • type: 'SCHEDULE_DEFINITION''


It is possible to define multiple parameters to be passed to the Oracle Enterprise Scheduler job. When adding additional parameters to the Oracle Enterprise Scheduler service payload in BPEL, you must first add a new parameter element to the DOM using an 'Insert-After' of the original parameter element, then use array subscripting to populate that new parameter with the correct values. Repeat as needed.

First, copy and clone the existing parameter element back into the variable using the Insert-After operation. This creates a second parameter element in the XML array. For example, see Figure 11-29.

Figure 11-29 Copy with Insert-After Operation

Copy with Insert-After operation
Description of "Figure 11-29 Copy with Insert-After Operation"

Second, create a new Copy operation and choose the parameter elements in the To/From areas of the dialog in the same manner as when copying values for the first parameter. However, in the lower right corner, change the XPath path to include a [2] (XML Arrays start at 1 and not 0) and click OK. Repeat as needed for each parameter required.

11.8.2 How to Invoke the ESSWebService setSubmitArgs Operation

In the BPEL process you add an invoke activity to perform the Oracle Enterprise Scheduler web service setSubmitArgs() operation.

To add the Invoke activity to use setsubmitArgs for a request using ESSWebService:

  1. In the Application Navigator, in Project1 expand SOA Content and select the BPEL file. For example, select BPELProcess1.bpel. This displays the BPEL swim lane.

  2. From the Component Palette, drag-and-drop an Invoke Activity and place the activity before callbackClient.

  3. Link the invoke activity to the ESSWebService by selecting the right arrow and dragging it to the Partner Link Service1. This brings up the Edit Invoke dialog.

  4. In the Edit Invoke dialog, in the Operation field select setSubmitArgs.

  5. In the Edit Invoke dialog, in the Input field click the Add icon. This displays the Create Variable dialog.

  6. In the Create Variable dialog, click OK.

  7. In the Edit Invoke dialog, in the Output field select the Add icon. This displays the Create Variable dialog.

  8. In the Create Variable dialog, click OK.

  9. In the Edit Invoke dialog, click OK. This displays the new invoke link to Service1.

  10. Select the Invoke activity and double-click the name Invoke_1 to select the text entry field. In the text entry field enter setSubmitArgs.

  11. From the Component Palette, drag-and-drop a Transform Activity and place the activity before the setSubmitArgs. This transformation maps the BPEL flow input variable to the setSubmitArgs input variable.

  12. Open the transformation activity. On the Transformation tab, in the Source area click the Add icon. This displays the Source Variable dialog.

  13. In the Source Variable dialog select inputVariable and click OK.

  14. In the transformation activity, on the Transformation tab, in the Target Variable field select setSubmitArgs_setSubmitArgs_InputVariable as the target.

  15. In the transformation activity, on the Transformation tab, in the Mapper File field, click Add to create a new mapper file.

  16. This creates a mapper file, as shown in Figure 11-30. Note that a "for-each" construct can be inserted by dragging an item from the XSLT Constructs area of the Component Palette.

    Figure 11-30 Transformation for Set Submit Arguments

    Transformation for set submit arguments
    Description of "Figure 11-30 Transformation for Set Submit Arguments"

  17. The transformation tool does not create exactly what is needed. You need to edit the XSLT source. In the source, find the following mapping.

    <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:arguments">
        <arguments>
          <xsl:value-of select="."/>
        </arguments>
      </xsl:for-each>
    

    Replace this with the following; add "tns:" as a qualifier to "arguments", resulting in the following fragment. Note that the transformation tool design tab may incorrectly complain that this is not a valid transformation:

    <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:arguments">
        <tns:arguments>
          <xsl:value-of select="."/>
        </tns:arguments>
      </xsl:for-each>
    

    Example 11-2 shows the complete transformation source file.

Example 11-2 Transformation Source for Set Submit Arguments Transformation

<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
  <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
  <mapSources>
    <source type="WSDL">
      <schema location="../BPELProcess1.wsdl"/>
      <rootElement name="BPELProcess1ProcessRequest"
                         namespace="http://xmlns.oracle.com/EssWebApplication/
                         Project1/BPELProcess1"/>
    </source>
  </mapSources>
  <mapTargets>
    <target type="WSDL">
      <schema location="../Service1.wsdl"/>
      <rootElement name="setSubmitArgs"
                         namespace="http://xmlns.oracle.com/scheduler"/>
    </target>
  </mapTargets>
  <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.0.0(build 090113.2000.2412) AT [FRI
       FEB 06 08:27:53 PST 2009]. -->
?>
<xsl:stylesheet version="1.0"
                 xmlns:xpath20="http://www.oracle.com/XSL/Transform/java
                                /oracle.tip.pc.services.functions.Xpath20"
                 xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/
                             business-process/"
                 xmlns:client="http://xmlns.oracle.com/EssWebApplication
                               /Project1/BPELProcess1"
                xmlns:oraext="http://www.oracle.com/XSL/Transform/java/
                              oracle.tip.pc.services.functions.ExtFunc"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:dvm="http://www.oracle.com/XSL/Transform/java/
                           oracle.tip.dvm.LookupValue"
                xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:med="http://schemas.oracle.com/mediator/xpath"
                xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.
                            mediator.service.common.functions
                    .GetRequestHeaderExtnFunction"
                xmlns:ids="http://xmlns.oracle.com/bpel/services/
                           IdentityService/xpath"
                xmlns:tns="http://xmlns.oracle.com/scheduler"
                xmlns:xdk="http://schemas.oracle.com/bpel/extension
                           /xpath/function/xdk"
                xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                xmlns:xref="http://www.oracle.com/XSL/Transform/java
                            /oracle.tip.xref.xpath.XRefXPathFunctions"
                xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                xmlns:ns0="http://xmlns.oracle.com/scheduler/types"
                xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:ora="http://schemas.oracle.com/xpath/extension"
                xmlns:socket="http://www.oracle.com/XSL/Transform/
                              java/oracle.tip.adapter.socket.ProtocolTranslator"
                xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                            exclude-result-prefixes="xsi xsl client plnk 
                            xsd ns0 wsdl tns soap12 soap mime xpath20 bpws oraext
                            dvm hwf med mhdr ids xdk xref ora socket ldap">
  <xsl:template match="/">
    <tns:setSubmitArgs>
      <tns:requestParameters>
        <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:
                              requestParameters/ns0:parameter">
          <ns0:parameter>
            <ns0:dataType>
              <xsl:value-of select="ns0:dataType"/>
            </ns0:dataType>
            <ns0:name>
              <xsl:value-of select="ns0:name"/>
            </ns0:name>
            <ns0:scope>
              <xsl:value-of select="ns0:scope"/>
            </ns0:scope>
            <ns0:value>
              <xsl:value-of select="ns0:value"/>
            </ns0:value>
          </ns0:parameter>
        </xsl:for-each>
      </tns:requestParameters>
      <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:arguments">
        <tns:arguments>
          <xsl:value-of select="."/>
        </tns:arguments>
      </xsl:for-each>
    </tns:setSubmitArgs>
  </xsl:template>
</xsl:stylesheet>

11.8.3 How to Invoke the ESSWebService addPPActions Operation

In the BPEL process you add an invoke activity to perform the Oracle Enterprise Scheduler web service addPPActions() operation.

To add the Invoke activity for addPPActions operation using ESSWebService:

  1. In the Application Navigator, in Project1 expand SOA Content and select the BPEL file. For example, select BPELProcess1.bpel. This displays the BPEL swim lane.

  2. From the Component Palette, drag-and-drop an Invoke Activity and place the activity before callbackClient.

  3. Select the Invoke activity and double-click the name Invoke_1 to select the text entry field. In the text entry field enter addPPActions.

  4. Link the invoke activity to the ESSWebService by selecting the right arrow and dragging it to the Partner Link Service1. This brings up the Edit Invoke dialog.

  5. In the Edit Invoke dialog, in the Operation field select addPPActions, as shown in Figure 11-31.

    Figure 11-31 Adding AddPPActions Operation

    Adding AddPP Actions
    Description of "Figure 11-31 Adding AddPPActions Operation"

  6. In the Edit Invoke dialog, in the Input field click the Add icon. This displays the Create Variable dialog.

  7. In the Create Variable dialog, click OK.

  8. In the Edit Invoke dialog, in the Output field select the Add icon. This displays the Create Variable dialog.

  9. In the Create Variable dialog, click OK.

  10. In the Edit Invoke dialog, click OK. This displays the new invoke link to Service1.

  11. From the Component Palette, drag-and-drop a Transform Activity and place the activity before the addPPActions. This transformation maps the BPEL flow input variable to the addPPActions input variable.

  12. Open the transformation activity. On the Transformation tab, in the Source area click the Add icon. This displays the Source Variable dialog.

  13. In the Source Variable dialog select inputVariable and click OK.

  14. In the transformation activity, on the Transformation tab in the Target Variable field select addPPActions_addPPActions_InputVariable as the target.

  15. In the transformation activity, on the Transformation tab in the Mapper File field, click Add to create a new mapper file. This displays the XSL transformation file.

  16. Create mappings as shown in Example 11-3.

    The requestParameters come from the addPPActions, overriding what is in the transformation. The remainder of the input still comes from the BPEL flow input variable. Assign requestParametersReturn/ns2:parameter of the addPPActions output variable to requestParameters/ns2:parameter of the addPPActions input variable, as in the previous examples.

    Example 11-3 addPPActions Transformations

    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
      <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
      <mapSources>
        <source type="WSDL">
          <schema location="../BPELProcess1.wsdl"/>
          <rootElement name="BPELProcess1ProcessRequest"
             namespace="http://xmlns.oracle.com/EssWebApplication/Project1/BPELProcess1"/>
        </source>
      </mapSources>
      <mapTargets>
        <target type="WSDL">
          <schema location="../Service1.wsdl"/>
          <rootElement name="addPPActions" namespace="http://xmlns.oracle.com/scheduler"/>
        </target>
      </mapTargets>
      <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.0.0(build 090113.2000.2412) AT [FRI FEB 06 10:29:28 PST 2009]. -->
    ?>
    <xsl:stylesheet version="1.0"
                    xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/
                                   oracle.tip.pc.services.functions.Xpath20"
                    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                    xmlns:client="http://xmlns.oracle.com/EssWebApplication/Project1/BPELProcess1"
                    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.
                                 services.functions.ExtFunc"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:med="http://schemas.oracle.com/mediator/xpath"
                    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.
                                mediator.service.common.functions.GetRequestHeaderExtnFunction"
                    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                    xmlns:tns="http://xmlns.oracle.com/scheduler"
                    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
                    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                    xmlns:xref="http://www.oracle.com/XSL/Transform/java/
                                oracle.tip.xref.xpath.XRefXPathFunctions"
                    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:ns0="http://xmlns.oracle.com/scheduler/types"
                    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                    xmlns:ora="http://schemas.oracle.com/xpath/extension"
                    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.
                                  adapter.socket.ProtocolTranslator"
                    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                    exclude-result-prefixes="xsi xsl client plnk 
                           xsd ns0 wsdl tns soap12 soap mime xpath20 bpws oraext dvm 
                           hwf med mhdr ids xdk xref ora socket ldap">
      <xsl:template match="/">
        <tns:addPPActions>
          <tns:requestParameters>
            <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:
                                  requestParameters/ns0:parameter">
              <ns0:parameter>
                <ns0:dataType>
                  <xsl:value-of select="ns0:dataType"/>
                </ns0:dataType>
                <ns0:name>
                  <xsl:value-of select="ns0:name"/>
                </ns0:name>
                <ns0:scope>
                  <xsl:value-of select="ns0:scope"/>
                </ns0:scope>
                <ns0:value>
                  <xsl:value-of select="ns0:value"/>
                </ns0:value>
              </ns0:parameter>
            </xsl:for-each>
          </tns:requestParameters>
          <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:postProcessAction">
            <tns:postProcessActions>
              <ns0:actionName>
                <xsl:value-of select="ns0:actionName"/>
              </ns0:actionName>
              <ns0:actionOrder>
                <xsl:value-of select="ns0:actionOrder"/>
              </ns0:actionOrder>
              <xsl:for-each select="ns0:arguments">
                <ns0:arguments>
                  <xsl:value-of select="."/>
                </ns0:arguments>
              </xsl:for-each>
              <ns0:fileMgmtGroup>
                <xsl:value-of select="ns0:fileMgmtGroup"/>
              </ns0:fileMgmtGroup>
              <ns0:description>
                <xsl:value-of select="ns0:description"/>
              </ns0:description>
              <ns0:onError>
                <xsl:value-of select="ns0:onError"/>
              </ns0:onError>
              <ns0:onSuccess>
                <xsl:value-of select="ns0:onSuccess"/>
              </ns0:onSuccess>
              <ns0:onWarning>
                <xsl:value-of select="ns0:onWarning"/>
              </ns0:onWarning>
            </tns:postProcessActions>
          </xsl:for-each>
        </tns:addPPActions>
      </xsl:template>
    </xsl:stylesheet>
    

11.8.4 How to Invoke the ESSWebService setStepsArgs Operation

In the BPEL process, you add an invoke activity to perform the Oracle Enterprise Scheduler web service addPPActions() operation.

As shown in Example 11-4, you can add the following to the BPELProcess1.xsd file to allow input for setStepsArgs.

Example 11-4 Enabling Input for setStepsArgs

<xs:element name="stepArgs" type="ns1:stepArgs"
                    minOccurs="0" maxOccurs="unbounded"/>

The main steps are as follows:

  1. Create a transformation to map the BPEL flow input variable to the setStepsArgs input variable.

    From BPEL Activities and Components, select Transform and place before setStepsArgs. Open the new transformation activity. Select inputVariable as the source and setStepsArgs_setStepsArgs_InputVariable as the target. Create a new mapper file. Create the mappings as shown in the SetStepsArgs transformation example.

  2. Create an assignment activity. In this example, you want the requestParameters to come from the previous step, addPPActions, overriding what is in the transformation. The remainder of the input still comes from the BPEL flow input variable. Assign requestParametersReturn/ns2:parameter of the addPPActions output variable to requestParameters/ns2:parameter of the setStepsArgs input variable, just as in previous examples.

    In the BPEL process you add an invoke activity to perform the Oracle Enterprise Scheduler web service submitRecurringRequest() operation. In this step you need to select the input and output for the Invoke Activity by associating values with the input and output variables.

To add the Invoke activity use setStepsArgs operation:

  1. In the Application Navigator, in Project1 expand SOA Content and select the BPEL file. For example, select BPELProcess1.bpel. This displays the BPEL swim lane.

  2. From the Component Palette, drag-and-drop an Invoke Activity and place the activity before callbackClient.

  3. Select the Invoke activity and double-click the name Invoke_1 to select the text entry field. In the text entry field enter setStepsArgs.

  4. Link the invoke activity to the ESSWebService by selecting the right arrow and dragging it to the Partner Link Service1. This brings up the Edit Invoke dialog.

  5. In the Edit Invoke dialog, in the Operation field select setStepsArgs as shown in Figure 11-32.

    Figure 11-32 Set Step Arguments Operation

    Set step arguments operation
    Description of "Figure 11-32 Set Step Arguments Operation"

  6. In the Edit Invoke dialog, in the Input field click the Add icon. This displays the Create Variable dialog.

  7. In the Create Variable dialog, click OK.

  8. In the Edit Invoke dialog, in the Output field select the Add icon. This displays the Create Variable dialog.

  9. In the Create Variable dialog, click OK.

  10. In the Edit Invoke dialog, click OK. This displays the new invoke link to Service1.

  11. From the Component Palette, drag-and-drop a Transform Activity and place the activity before the setStepsArgs. This transformation maps the BPEL flow input variable to the setStepsArgs input variable.

  12. Open the transformation activity. On the Transformation tab, in the Source area click the Add icon. This displays the Source Variable dialog.

  13. In the Source Variable dialog select inputVariable and click OK.

  14. In the transformation activity, on the Transformation tab in the Target Variable field select setStepsArgs_setStepsArgs_InputVariable as the target.

  15. In the transformation activity, on the Transformation tab in the Mapper File field, click Add to create a new mapper file. This displays the XSL transformation file.

  16. Create mappings as shown in Figure 11-33 using the mappings shown in Example 11-5.

    Figure 11-33 Using the Transformation for Set Step Arguments Operation

    Using the transformation for the set step args operation
    Description of "Figure 11-33 Using the Transformation for Set Step Arguments Operation"

  17. Create an assignment activity. In this example, we want the requestParameters to come from the previous step, addPPActions, overriding what is in the transformation. There remainder of the input still comes from the BPEL flow input variable. Assign the requestParametersReturn/ns2:parameter of the addPPActions output variable to the requestParameters/ns2:parameter of the setStepsArgs input variable, just as in previous examples.

Example 11-5 Mapping Transformation for Set Steps Arguments Operation

<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
  <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
  <mapSources>
    <source type="WSDL">
      <schema location="../BPELProcess1.wsdl"/>
      <rootElement name="BPELProcess1ProcessRequest"namespace="http://xmlns.
           oracle.com/EssWebApplication/Project1/BPELProcess1"/>
    </source>
  </mapSources>
  <mapTargets>
    <target type="WSDL">
      <schema location="../Service1.wsdl"/>
      <rootElement name="setStepsArgs"                
        namespace="http://xmlns.oracle.com/scheduler"/>
    </target>
  </mapTargets>
  <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.0.0(build 090113.2000.2412) AT [FRI
       FEB 06 10:56:22 PST 2009]. -->
?>
<xsl:stylesheet version="1.0"
                xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.
               functions.Xpath20"
                xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                xmlns:client="http://xmlns.oracle.com/EssWebApplication/Project1/BPELProcess1"
                xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.
              functions.ExtFunc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:med="http://schemas.oracle.com/mediator/xpath"
                xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.
            common.functions.GetRequestHeaderExtnFunction"
                xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
           xmlns:tns="http://xmlns.oracle.com/scheduler"
                xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
           xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.
            XRefXPathFunctions"
                xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:ns0="http://xmlns.oracle.com/scheduler/types"
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                xmlns:ora="http://schemas.oracle.com/xpath/extension"
                xmlns:socket="http://www.oracle.com/XSL/Transform/java
                             /oracle.tip.adapter.socket.ProtocolTranslator"
                xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                            exclude-result-prefixes="xsi xsl client plnk xsd ns0
                            wsdl tns soap12 soap mime xpath20 bpws oraext dvm
                            hwf med mhdr ids xdk xref ora socket ldap">
  <xsl:template match="/">
    <tns:setStepsArgs>
      <tns:requestParameters>
        <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:
           requestParameters/ns0:parameter">
          <ns0:parameter>
            <ns0:dataType>
              <xsl:value-of select="ns0:dataType"/>
            </ns0:dataType>
            <ns0:name>
              <xsl:value-of select="ns0:name"/>
            </ns0:name>
            <ns0:scope>
              <xsl:value-of select="ns0:scope"/>
            </ns0:scope>
            <ns0:value>
              <xsl:value-of select="ns0:value"/>
            </ns0:value>
          </ns0:parameter>
        </xsl:for-each>
      </tns:requestParameters>
      <xsl:for-each select="/client:BPELProcess1ProcessRequest/client:stepArgs">
        <tns:stepArgsList>
          <xsl:for-each select="ns0:arguments">
            <ns0:arguments>
              <xsl:value-of select="."/>
            </ns0:arguments>
          </xsl:for-each>
          <ns0:NLSOptions>
            <ns0:language>
              <xsl:value-of select="ns0:NLSOptions/ns0:language"/>
            </ns0:language>
            <ns0:numericCharacters>
              <xsl:value-of select="ns0:NLSOptions/ns0:numericCharacters"/>
            </ns0:numericCharacters>
            <ns0:territory>
              <xsl:value-of select="ns0:NLSOptions/ns0:territory"/>
            </ns0:territory>
          </ns0:NLSOptions>
          <xsl:for-each select="ns0:PPActions">
            <ns0:PPActions>
              <ns0:actionName>
                <xsl:value-of select="ns0:actionName"/>
              </ns0:actionName>
              <ns0:actionOrder>
                <xsl:value-of select="ns0:actionOrder"/>
              </ns0:actionOrder>
              <xsl:for-each select="ns0:arguments">
                <ns0:arguments>
                  <xsl:value-of select="."/>
                </ns0:arguments>
              </xsl:for-each>
              <ns0:fileMgmtGroup>
                <xsl:value-of select="ns0:fileMgmtGroup"/>
              </ns0:fileMgmtGroup>
              <ns0:description>
                <xsl:value-of select="ns0:description"/>
              </ns0:description>
              <ns0:onError>
                <xsl:value-of select="ns0:onError"/>
              </ns0:onError>
              <ns0:onSuccess>
                <xsl:value-of select="ns0:onSuccess"/>
              </ns0:onSuccess>
              <ns0:onWarning>
                <xsl:value-of select="ns0:onWarning"/>
              </ns0:onWarning>
            </ns0:PPActions>
          </xsl:for-each>
          <ns0:stepPath>
            <xsl:value-of select="ns0:stepPath"/>
          </ns0:stepPath>
        </tns:stepArgsList>
      </xsl:for-each>
    </tns:setStepsArgs>
  </xsl:template>
</xsl:stylesheet>

11.9 Securing the Oracle Enterprise Scheduler Web Service

You can secure any of the Oracle Enterprise Scheduler web service operations using an Oracle Web Services Manager security policy.

For more information, see the "Securing and Administering WebLogic Web Services" chapter in the Oracle Fusion Middleware Security and Administrator's Guide for Oracle Web Services.

11.9.1 How to Secure the Oracle Enterprise Scheduler Web Service

Securing the Oracle Enterprise Scheduler web service involves attaching one security policy to the method that calls the web service, and another to the asynchronous callback to the SOA composite.

Note:

Oracle Fusion Applications make use of an Oracle WSM feature called global policy attachments (GPA). Using GPA, policies are not attached locally, but are specified at a global level. At runtime, components simply inherit the global policy and Oracle WSM enforces it.

Unlike local policy attachments (LPA), which need to be added at every web service client and server, global policy attachment (GPA) can be attached at a domain level. This makes it easy for the system administrator to have a uniform policy for all web services across the domain.

To secure the Oracle Enterprise Scheduler web service:

  1. Open the SOA composite that calls the Oracle Enterprise Scheduler web service.

  2. In the swim lane on the right, right-click the Oracle Enterprise Scheduler web service and select Configure WS Policies > For Request.

    The Configure SOA WS Policies window displays.

  3. In the Security field, click the add button to attach a security policy to the client.

    Select the policy oracle/wss11_saml_token_with_message_protection_client_policy or oracle/wss11_username_token_with_message_protection_client_policy as shown in Figure 11-34, and click OK.

    Figure 11-34 Client Security Policy for the Oracle Enterprise Scheduler Web Service

    Client Security Policy for the ESS Web Service
    Description of "Figure 11-34 Client Security Policy for the Oracle Enterprise Scheduler Web Service"

  4. In the swim lane on the right, right-click the Oracle Enterprise Scheduler web service and select Configure WS Policies > For Callback.

    The Configure SOA WS Policies window displays.

  5. In the Security field, click the add button to attach a security policy to the callback method.

    Select the policy oracle/wss11_saml_token_with_message_protection_service_policy, as shown in Figure 11-35, and click OK.

    Figure 11-35 Callback Security Policy for the Oracle Enterprise Scheduler Web Service

    Callback Security Policy for the ESS Web Service
    Description of "Figure 11-35 Callback Security Policy for the Oracle Enterprise Scheduler Web Service"

  6. Save your changes to the SOA composite file.

11.9.2 What Happens When You Secure the Oracle Enterprise Scheduler Web Service

The security policy oracle/wss11_saml_token_with_message_protection_client_policy secures the method that calls the Oracle Enterprise Scheduler web service. The security policy wss11_saml_token_with_message_protection_service_policy secures the asynchronous callback method that the web service uses to call back the SOA composite.

11.10 Deploying and Testing the Project

Next, you deploy the BPEL process to the Oracle WebLogic Server as described in "Deploying SOA Composite Applications" in Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite. Following deployment, you can test the web service using Oracle SOA Console.

11.10.1 How to Test the Web Service

You can test a web service using the following procedure from the SOA Console.

Note that it is not supported to invoke web service operations by accessing the web service directly from a browser.

To test the web service:

  1. Open a browser and go to the SOA Console at the following URL.

    http://<machine>:<port>/soa-console

  2. In the Applications area, select the deployed composite.

  3. Click the Test dropdown and choose the service endpoint Test Client.

  4. This an endpoint page where you can provide input to the BPEL process.

  5. In the payload area, enter values for the job parameters.

  6. Click Invoke.

  7. Refresh the console page.

  8. Click the latest instance ID to verify the progress of the BPEL file.