Sun Worklist Manager Service Engine User's Guide

Creating a Custom Worklist Manager Console

You can create a custom Worklist Manager Console by calling the client API, TaskCommonService, provided by the Worklist Manager Service Engine. The API is defined in the TaskCommon.wsdl file, which is generated by building the Worklist Module project.

Creating the Web Application and Composite Application

TaskCommon.wsdl is an abstract WSDL document with no bindings or services. You need to make the WSDL document concrete by adding bindings and services for the document. The following procedure does not provide detailed information for adding bindings and services. Refer to the user documentation for the type of binding you are adding for more information.

ProcedureTo Configure the Web Application

Before You Begin

This task requires that you have already created and built the Worklist Module project that defines the tasks.

  1. Create a web application project in the NetBeans IDE that defines the Worklist Manager Console.

  2. Copy the TaskCommon.wsdl file from the Worklist Module project build directory into the web application project.

    This file is located in the Worklist Module project home directory under the /build folder.

  3. From the web application project, open the newly copied TaskCommon.wsdl file in the WSDL Editor.

  4. In WSDL view, right-click Bindings and select Add Binding to add any necessary bindings and services to the file.

    Figure shows the Create New Binding dialog box.
    Note –

    When you add the bindings from the WSDL view, the binding operations are created automatically.


  5. Do the following to create a Web Service Client in the web application that invokes TaskCommonService in TaskCommon.wsdl.

    1. Right-click the web application project, point to New, and then select Web Service Client.

    2. On the New Web Service Client Wizard, select Local File and then browse to and select the TaskCommon.wsdl file.

      Figure shows the New Web Service Client Wizard.
    3. Click Finish.

  6. You can specify the package name for the Web Service Client rather than using a wrapper. To specify the package name, do the following:

    1. Expand Web Service Reference, right-click TaskCommon, and then select Edit Web Service Attributes.

      The attribute editor appears.

    2. Click the WSDL Customization tab, and then expand Global Customization.

    3. Deselect the Use Default check box, and enter the following class as the package name:

      com.sun.workflow.client

      Figure shows the Web Service Attributes dialog
box.
    4. Click OK, and then click OK on the information dialog box.

  7. Clean and build the web application project.

    This generates the client stub classes in the build/generated folder.

  8. Define you custom Worklist Manager Console web pages. Use the generated classes in your web application to invoke operations from TaskCommon.wsdl.

    For a reference of the client API, see WLM Client WSDL API.

ProcedureTo Create the Composite Application

  1. In the NetBeans Projects window, create a new composite application project.

  2. Drag the web application project you created above to the JBI Module section of the CASA Editor.

  3. Build the composite application.

    A SOAP endpoint is added, along with a connector to JBI module.

  4. Delete the connector between the endpoint and JBI module.

  5. Right-click the SOAP provide endpoint, and select Properties. On the Properties window that appears, click Disable in BC, and then click Close.

  6. Drag an External Service Unit from the palette to the External Modules section (left panel) of the CASA Editor.

  7. Name the External Service Unit WLMSE-TaskCommon.

  8. Drag a Provide endpoint to the new service unit. Right-click the endpoint and click Properties. Configure the endpoint as follows:

    1. Click the ellipsis next to the Interface Name property. On the Editor that appears, enter TaskCommonPortType as the Local Name and enter ns1:http://jbi.com.sun/wfse/wsdl/TaskCommon as the Namespace.

      Figure shows the QName Editor for the interface
name.
    2. Click the ellipsis next to the Service Name property. On the Editor that appears, enter TaskCommonService as the Local Name and enter ns1:http://jbi.com.sun/wfse/wsdl/TaskCommon as the Namespace.

      Figure shows the QName Editor for the service
name.
    3. Name the endpoint TaskCommonPort.

      The completed properties should look similar to the following figure.

      Figure shows the completed endpoint properties.
  9. Link the JBI Module with the External Service Unit.

  10. Build and deploy the composite application.

    The composite application should appear similar to the following figure.

    Figure shows the completed composite application.

WLM Client WSDL API

The WLM SE provides a static WSDL file that exposes several functions that allow a web service to obtain task-related information from the Worklist Manager database.

GetTaskList

The GetTaskList function is called when a user performs a query for tasks. It returns a worklist of tasks that match the criteria that are passed in as parameters.

GetTask

The GetTask function returns a task whose task ID and user name match those that are passed in as parameters.

ClaimTask

The ClaimTask function is called when a user claims a task. It changes the status of a task to Claimed and adds the user name of the person who claimed the task to the task properties. It returns a result code of SUCCESS or FAILED.

CompleteTask

The CompleteTask function is called when a user marks a task as complete. It changes the status of a task to Complete and returns a result code of SUCCESS or FAILED.

GetTaskInput

The GetTaskInput function retrieves the data from the input message for the task that matches the given task ID and user name.

GetTaskOutput

The GetTaskOutput functions retrieves the data for the output message for the task that matches the given task ID and user name.

SetTaskOutput

The SetTaskOutput function sets the data for the output message for the task that matches the given task ID and user name. It returns a result code of SUCCESS or FAILED.

ReassignTask

The ReassignTask function reassigns the task with the given task ID to the specified user. It returns a result code of SUCCESS or FAILED.

RevokeTask

The RevokeTask function reverses a claim made to the task with the given task ID and reverts the Claimed By property to its previous value. It returns a result code of SUCCESS or FAILED.