Index Changes

Worklist Manager Service Engine - The Human Task Engine



New: WLM reached Milestone 1, please see Milestone 1 downloads (Known issues )
New: Lightweight (No Xform) web console is available, please see Lightweight console

Table of Content

User Guide and Samples:

Tutorials:

Designer Features:

Features:



Overview


A business process or workflow is a coordinated chain of activities intended to produce a business result. Total automation of business processes is practically unachievable without considering human interaction. In some processes, human workflow is a major emphasis. In others, human participation is only required on an exception basis.

Worklist Manager SE (WLMSE) is a JBI based engine, which provides task management and human intervention in a business process.Worklist Manager SE uses a simple task definition language to define the tasks related functionality like task assignment to user/groups, escalation, timeout etc.


Back to Top

Why A Separate Worklist Manager SE


Following are some of the reasons:
  • BPEL does not provide human interaction.
  • Extending BPEL with new custom extension is cumbersome and makes BPEL complex, non portable.
  • Clear separation of human interaction/task related functionality into a separate component.
  • A simple language to define tasks functionality.

Also see overview of different concepts .


Back to Top

Current Features



Back to Top

WLM Task Definition


WLM Task Definition file is the main artifact to specify task behavior in WLMSE. User can specify things like a task, task assignment, escalation, timeout and notification etc here.

Each task in task definition is exposed as a web service operation by WLMSE. For each task in task definition, a request reply web service operation is defined. The input message of this operation is the task input and output message of this operation is the task output.

Task Definition Schema


Back to Top

Task Basics(title, priority,assignment)


Here is the sample structure of WLM Task Definition File including title, priority and assignment
<task name="ApprovePurchase" portType="wsdl:ApprovePurchasePT" operation="ApprovePurchase"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase"
xmlns="http://jbi.com.sun/wfse" 
xmlns:cur="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" 
xmlns:wsdl="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL"
 xmlns:po="http://wlmse.sample/po">
    <import namespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL" 
                location="ApprovePurchase_TM_BPEL.wsdl"/>
        <!-- Make sure to use single quotes for literal value in xpath enabled expression -->
    <title expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">'This is a purchase order'</title>
        <!-- priority is in 1-10 scale with 10 to be the highest -->
    <priority expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">'5'</priority>
    <assignment>
        <!-- 0-* user -->
        <user>'john'</user>
        <!-- 0-* group -->
        <group>'CustomerServiceRep'</group>
    </assignment>
</task>


Back to Top

Task Escalation


WLMSE supports task escalation. Task escalation is useful in cases where a user does not finish a task in certain time period, so the task will be assigned to next user. Task can be escalated based on duration or deadline.
Following code shows how to define escalation.
<task xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://jbi.com.sun/wfse" 
        targetNamespace="http://localhost/WorklistApp5/ApprovePurchase" name="ApprovePurchase" xmlns:ns0="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL" portType="ns0:ApprovePurchasePT" operation="ApprovePurchase" xmlns:ns="http://wlmse.sample/po" xmlns:ns1="http://j2ee.netbeans.org/wsdl/EmailNotificationHandler"
        xmlns:cur="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions">
    <import location="ApprovePurchase_TM_BPEL.wsdl" namespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL"/>
    <title>'This is a task for purchase order'</title>
    <priority>'5'</priority>
    <assignment>
        <group>'CustomerServiceRep'</group>
    </assignment>
    <escalation>
        <duration>'P0Y0M0DT0H3M0S'</duration>
        <assignment>
            <user>'dale'</user>
        </assignment>
    </escalation>
</task>

Also see described in User Guide


Back to Top

Task Timeout


WLMSE supports task time-out. Task time-out can be useful as the last resort after escalation.
For example, the task is not completed by anyone within a certain time period and will be treated as FAILED and returns to BPEL with a system fault.
A task can time-out based on a deadline or duration. Following example shows the code require to implement task time-out.

<task xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://jbi.com.sun/wfse" 
        targetNamespace="http://localhost/WorklistApp5/ApprovePurchase" name="ApprovePurchase" xmlns:ns0="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL" portType="ns0:ApprovePurchasePT" operation="ApprovePurchase" xmlns:ns="http://wlmse.sample/po" xmlns:ns1="http://j2ee.netbeans.org/wsdl/EmailNotificationHandler"
        xmlns:cur="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions">
    <import location="ApprovePurchase_TM_BPEL.wsdl" namespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL"/>
    <title>'This is a task for purchase order'</title>
    <priority>'5'</priority>
    <assignment>
        <group>'CustomerServiceRep'</group>
    </assignment>
        <timeout>
            <deadline expressionLanguage="xpath">'2009-03-01T23:00:00'</deadline>
        </timeout>
       
        <timeout>
            <duration expressionLanguage="xpath">'P0Y0M3DT0H0M0S'</duration>       
        </timeout>
</task>


Back to Top

Task Notification

There is a simple task notification now supported which allows sending notification using smtp bc. The notification takes place when task state changes. For example when task is assigned to a set of users, send them notification regarding tasks to work on. When task is completed by a user send a notification to user's manager regarding completion of the task.

<task xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://jbi.com.sun/wfse" 
        targetNamespace="http://localhost/WorklistApp5/ApprovePurchase" name="ApprovePurchase" xmlns:ns0="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL" portType="ns0:ApprovePurchasePT" operation="ApprovePurchase" xmlns:ns="http://wlmse.sample/po" xmlns:ns1="http://j2ee.netbeans.org/wsdl/EmailNotificationHandler"
        xmlns:cur="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions">
    <import location="ApprovePurchase_TM_BPEL.wsdl" namespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL"/>
    <title>'This is a task for purchase order'</title>
    <priority>'5'</priority>
    <assignment>
        <group>'CustomerServiceRep'</group>
    </assignment>
    <action name="Task_Assigned" type="Assigned">
        <localNotification reference="notifyUsers"/>
    </action>
    <notification name="notifyManager">
        <email portType="ns1:NotificationHandlerPortType" operation="NotificationHandlerOperation">
            <address>'mei.w.gao@gmail.com'</address>
        </email>
        <message>
            <subject>'The approve purchase order task has been completed'</subject>
            <body>concat(concat(' Purchase Order for ', $TaskInput.part1/ns:purchaserName), ' has been completed.')</body>
        </message>
    </notification>
    <notification name="notifyUsers">
        <email portType="ns1:NotificationHandlerPortType" operation="NotificationHandlerOperation">
            <address>'mei.wu@sun.com'</address>
        </email>
        <message>
            <subject>'There is a new task of approve purchase order assigned to you'</subject>
            <body>'The task can be found at http://localhost:8080/WorklistWebApplication/wlm-jsp/wlmEntry.jsp'</body>
        </message>
    </notification>
</task>

Also see described in User Guide
User can plug in a custom type of Notification such as let WLM invokes a web service when task status changes, please see Custom Notification
Back to Top

Xpath Enabled Task Definition


Introducing Variables and Expressions into WLMSE is to allow the elements (Assignment, Escalation, Timeout, etc) in task definition and properties of task instance (Priority, Title, etc) to be dynamically derived from input message.

Details on Xpath Enabled Task Definition

Note: We will provide mapper to enter xpath graphically in the future.


Init and Action


User can initialize task output and assign value automatically to task output using Init and Action, please see Details

Back to Top

Netbeans Worklist Project


Create a worklist project in NB :

  1. File --> New Project --> Worklist Module.
  2. Create a WSDL for the task
  3. Create Task Definition (.wf) using wizard (New Task Definition) pointing to the operation in the WSDL for the task
  4. Fill in title, priority and Assignment
  5. Add Init using Mapper to initialize some fields in $TaskOutput (Optional)
  6. Use literal or Xpath for title, priority and Assignment
  7. Add Escalations (Optional)
  8. Add Notifications (Optional)
  9. Add Actions to define when to trigger Notifications and automatic $TaskOutput change (Optional)
  10. Use Mapper to add automatic value assignment for automatic $TaskOutput change in Actions (Optional)
  11. Add the project (and the related bpel project ) to a composite application, edit casa to link the ports between bpel and wlmse


Back to Top

Netbeans Worklist Wizard


A simple wizard is available which creates worklist task definition file and prompt user for various task related configuration. This allows user to get started with task definition without any coding. Work is under way to launch the wizard from BPEL editor when a human interaction step is needed


Back to Top

Netbeans Worklist Editor


A simple Worklist task definition editor is available which creates worklist task definition file and prompt user for various task related configuration. This allows user to get started with task definition without any coding.


Back to Top

Automatic XForm Generation


Automatic XForm Generation is to generate XForm for task input and task output based on the schema of input and output. The generated XForm can be modified by user. For example, user can add a CSS stylesheet element or modify the form element labels and attributes.
This allows for a generic worklist application to manage different tasks, each provides its rendering XForm.

The sample xform is here


Back to Top

Generic Web Application With Pluggable XForm UI


WLMSE comes with a generic Worklist Web Application which provides out of box worklist application for a user to see his tasks and work on them. The web application interacts with WLMSE using static WSDL client api.

Worklist Web Application also provides automatic UI for tasks based on generated XForm as available in the deployed worklist application. See more details about how XForms are generated in Automatic XForm Generation section.


Back to Top

Static WSDL For WLM Client


WLMSE provides a static client WSDL for a web service client to get task related information.

The static client WSDL provides a generic API to work with WLMSE tasks. Following are the operations exposed in static client WSDL:

TaskList GetTaskList(taskId)
ClaimTask(taskId)
CompleteTask(taskId)
xsd:anyType GetTaskInput(taskId)
xsd:anyType GetTaskOutput(taskId)
SetTaskOutput(taskId, xsd:anyType)
ReassignTask(taskId, Role, User)
RevokeTask(taskId)
GetTaskXForm(taskId)

Please also see described in User Guide
Back to Top

WLMSE Architecture


WLMSE architecture is simple. It is a JBI Based Service Engine which provides worklist and task management functionality. It uses a simple task definition to describe the task related functionality. (More on task definition in later sections)

Following diagram shows the architecture:

The client APIs invoked by a web application (ex: servlet or jsp) is intercepted by JavaEE Service Engine. The web application is secured using the standard J2EE security mechansim available for web application. When the client API is invoked, the subject information about the logged in user is passed along with each call. This subject information is important for WLMSE client API to provide user specific task list etc.

Like any other JBI component, WLMSE processes a service unit (SU) jar as its deployment unit. This SU jar includes task definition, wsdl which binds task in task definition to a wsdl operation, static and dynamic client wsdl, Xform files etc.


Back to Top

BPEL And Worklist Manager SE Interaction

Following diagram illustrates a typical interaction between various open jbi components. This also shows how a BPEL business process can invoke a web service operation implemented by Worklist Manager SE for task management.

For more information see this presentation


Back to Top

WLM Console


WLM Console How-Tos


Back to Top

LDAP


LDAP can be used for authentication, authorization and user management in WLM. The authentication and authorization for work list client application through LDAP is based on LDAP realm supported in Glassfish and Java EE security model,
in addition to that, WLM integrates LDAP in providing the following feature:

  • Assignment and Escalation to a user/group managed by LDAP
  • Provide LDAP xpath functions to allow assign/escalate the task to a user's manager, sends emails to a specific user or his/her manager using the email address on LDAP.

Details on LDAP configuration for WLMSE
Back to Top

Use MySQL


MySQL is supported in addition to Derby and Oracle.

Using MySQL, a database named "WORKFLOW" (or something else) must be created using MySQL tools, an account with similar privilege to Oracle user (see Using Oracle in WLM) must be created with an password.

Define datasource

Note: The following statement assumes the user and pwd is root/pwd:

asadmin create-jdbc-connection-pool --host localhost --port 4848 --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource --restype javax.sql.DataSource --allownoncomponentcallers=true --property portNumber=3306:user=root:password=pwd:serverName=localhost:databaseName=WORKFLOW WorkflowMySQLPool 

asadmin create-jdbc-resource --host localhost --port 4848 --connectionpoolid  WorkflowMySQLPool jdbc/__workflowMySQL


Make sure you use the created jndi resource and MySQL as data source type for MySQL in wlmse property


Back to Top

Use Oracle


Using Oracle, an Oracle User with Password should be created with privileges, for example:

CREATE TABLESPACE "WLMSE_USER_DB"
 DATAFILE
  'WLMSE_USER_DB1.dat' SIZE 2000M,
  'WLMSE_USER_DB2.dat' SIZE 2000M;
  
CREATE USER WLMSE_USER IDENTIFIED BY WLMSE_USER
DEFAULT TABLESPACE WLMSE_USER_DB
QUOTA UNLIMITED ON WLMSE_USER_DB
TEMPORARY TABLESPACE temp
QUOTA 0M ON system;

GRANT CREATE session to WLMSE_USER;
GRANT CREATE table to WLMSE_USER;
GRANT CREATE procedure to WLMSE_USER;
GRANT CREATE sequence to WLMSE_USER;

--To run these commands you need to be logged in as " connect sys as sysdba"
grant select on sys.dba_pending_transactions to WLMSE_USER;
grant select on sys.pending_trans$ to WLMSE_USER;
grant select on sys.dba_2pc_pending to WLMSE_USER;
grant execute on sys.dbms_system to WLMSE_USER;
grant select on SYS.dba_2pc_neighbors to WLMSE_USER;
grant force any transaction to WLMSE_USER;



Define datasource

Create jdbc connection pool and jdbc resource for the oracle database in glassfish.

asadmin create-jdbc-connection-pool --host localhost --port 4848 --datasourceclassname oracle.jdbc.pool.OracleDataSource --restype javax.sql.DataSource --allownoncomponentcallers=true --property "portNumber=1521:user=WLMSE_USER:password=WLMSE_USER:serverName=localhost:databaseName=orcl:url=jdbc\:oracle\:thin\:@localhost\:1521\:orcl" WorkflowOraclePool 

asadmin create-jdbc-resource --host localhost --port 4848 --connectionpoolid  WorkflowOraclePool jdbc/__workflowOracle


Set jndi and Oracle type in wlmse property sheet

Make sure you use the created jndi resource and Oracle as data source type for Oracle in wlmse property



Back to Top

Server Driven Pagination


Pagination solves the scalability problem in the case the query results for GetTaskList returns large number of tasks.
    <message name="GetTaskListRequestMsg">
        <part name="queryString" type="ns1:QueryType"/>
        <part name="userId" type="xsd:string"/>
        <part name="start" type="xsd:int"/>
        <part name="pageSize" type="xsd:int"/>
    </message>

The GetTaskListRequestMsg in TaskCommon.wsdl is the request msg format for GetTaskList operation. part "start" indicates the start index of a page and the "pageSize" is the number of tasks per page.
Note: If pageSize == 0, no pagination will be done and all tasks will be returned.
The way to determine whether there are more tasks to be returned is in the return msg: GetTaskListResponseMsg

            <xsd:complexType name="TaskListType">
                <xsd:sequence>
                    <xsd:element name="totalRecords" type="xsd:int" />
                    <xsd:element name="returnedRecords" type="xsd:int" />
                    <xsd:element name="task" type="ns1:TaskType" minOccurs="0" maxOccurs="unbounded">
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>

totalRecords, returnedRecords and the start part in GetTaskListRequestMsg in conjunction provide information on the current page being returned and the start index of next page (if there is one). If there are no more pages, returnedRecords will be 0 and no tasks will be returned.

For example:
There are 120 tasks, and GetTaskListRequestMsg1 sets pageSize to be 20 and start = 0, it returns 20 tasks with totalRecords = 120 and returnedRecords = 20, the next page will start with 20, the 3nd page will start with 40 ... Assuming pageSize = 20 for every page, there will be 6 pages, however if more tasks are created or completed at the same time, the query executes on the current records in the database, therefor totalRecords changes accordingly.

The Sample Worklist Manager Console has built-in pagination that utilizes this feature, pageSize is user configurable on wlm-jsp/wlmEntry.jsp:

        <script type="text/javascript">
        
            <!-- User Configurable Begin -->
            var refreshInterval = 10000; //default refreshing = 10 sec
            var pageStart = 0;
            var pageSize = 20; //Pagination Enabled, tasks per page, 0 means no pagination
            var savedSort = "id";
            var savedDir = "ASC";
            <!-- User Configurable End -->


Back to Top

Download Design Time tooling


The user guide contains latest tooling bits , samples and instructions to install:

Issues And ToDos


Back to Top

Project Plan


Back to Top

Access Count: 118
StatCounter Access Count :

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-124) was last changed on 14-Sep-09 17:57 PM, -0700 by MeiWu