Index Changes

Table of Contents



Known Issues


  1. XForm generation failed if the complex type is based on an extension
  2. WLM task xpathes are not evaluted when type attribute is used in part wsdl element to specify type of input or output of wlm task

Important Notes


  1. Worklist Manager Console is best viewed in FireFox 3
  2. Both JDK 5 and 6 are supported

Downloads


Install components

Notes:
WLM component installer for Netbeans 6.7 is not available yet.

  • Download samples:
a. Basic Purchase Order Sample
b. Xpath enabled Purchase Order Sample
c. Xpath + Escalation +Notification enabled Purchase Order Sample
d. LDAP + Xpath + Escalation +Notification enabled Purchase Order Sample
  • Download Worklist Console Web Application:
Worklist Manager Console Web Application
  • (Optional) Download lightweight Worklist Console Web Application (please see What it is):
Lightweight Worklist Manager Console Web Application

Notes:
1. If you download Component Installer in jar format, you would run the installer by executing :

java -jar path-to-jar
and follow the instructions on screen.
2. You will need to run BPEL SE component installer as well

Prerequisites


1. Please see Downloads section above for required components and projects to download.
2. Start glassfish
3. (This step has been done by the component installer, user can skip this step if the default datasource is used.) Create the default derby data source and restart glassfish. If you do not use the default data source, you should create the data source of your choice and change both the DataSource JNDI and DataSource Type (see Figure-1 DataSource)
glassfish/bin/asadmin create-jdbc-connection-pool --host localhost --port 4848 --datasourceclassname org.apache.derby.jdbc.ClientDataSource --restype javax.sql.DataSource --allownoncomponentcallers=true --property portNumber=1527:password=WORKFLOW:user=WORKFLOW:serverName=localhost:databaseName=WORKFLOWDB:connectionAttributes=";create\=true" WorkflowPool

glassfish/bin/asadmin create-jdbc-resource --host localhost --port 4848 --connectionpoolid WorkflowPool jdbc/__workflow

4. Start sun-wlm-engine, sun-bpel-engine, sun-http-binding, sun-emil-binding
5. (User can skip this step if the default datasource is used.) Change datasource on sun-wlm-engine if necessary

Figure-1 Datasource Configuration

Notes for all sample projects

In all three samples, the xform files (*.xhtml) in worklist project src folders are generated by the build process, user may remove them and let system regenerate
based on the input and output message schema, the system will not regenerate the xform file if it is present (to preserve the modifications made by the user),
hence, if the schema of the input/output is changed, user will need to remove the xform file before building the project, otherwise the xform will not be updated.


Sample Projects

Basic Purchase Order Sample

Following flowchart shows the use case scenario. An end client submits the purchase order to a bpel process. If the amount is greater than $200 then bpel process invokes an operation on
WLMSE. WLMSE executes the logic defined in task definition file corresponding to the operation it implements. In this case a task is assigned to a user/group.

User logs in to Worklist Web application and completes the task. Once the task is completed, WLMSE sends user's completed response to bpel process. Bpel process receives the
response from WLMSE and replies to end client.

This demo also demonstrates support for XForm for out of the box UI for task input and output.
Figure-2 Purchase Order Business Process


Take a look at the ApprovePurchase.wf in PurchaseOrderWorklistApp:
The Title is a String for the task to show on task list, Priority is a value between 1 - 10, the Assignment can contain assignees as Users and/or Groups, in this sample, CustomerServiceRep group will be assigned

Figure-3 Basic Design View

The source view shows the values in

<title>, <priority>, <assignment><group>
as text surrounded by single quotes, which is the standard xpath representation of literal (since Priority is Number, you may use a number between 1 to 10 directly without single quotes)
The source view shows <action><changeVariables>, the action is described in details in http://wiki.open-esb.java.net/Wiki.jsp?page=WLMSEInit-Action.
In this sample, when task is to be completed (type="Completed"), the system sets up Task Output using xpath, similar to bpel:copy.

Xpath Enabled Purchase Order Sample

The use case of Xpath enabled Purchase Order Sample works the same as Basic Purchase Order Sample, but it has more use of xpath in the task definition (see http://wiki.open-esb.java.net/Wiki.jsp?page=WLMSEXPath)
Take a look at the ApprovePurchase.wf in PurchaseOrderWorklistApp:
The values in Title, Priority, Assignment all use xpath to extract from Task Input message, the "=" sign means the text follows will be an xpath rather than a text literal (similar to using "=" to start a function in a spreadsheet).
In editor view, if user enters a value starting with "=", it means the value will be treated as an xpath and editor will not surround it with single quotes
Note:"=" is not part of the xpath and it only used in design view but not in source view

Figure-5 Xpath Design view

Compared to Figure-5 Xpath Design View, the values in

<title>, <priority>, <assignment><group>
have no "=" as prefix, also they are not surrounded by single quotes as in Figure-4 Basic Source View
Figure-6 Xpath Source View


You can also modify the generated xform (*.xhtml) to change the label of the fields or remove some fields to hide them on screen, you can do it for both input (in inputXForm) and output (in outputXForm)
In Figure-7 Xpath Xform-input below, the Priority and Users generated in xform are removed since they are not for display

Figure-7 Xpath Xform-input

In Figure-8 Xpath Xform-output below, the Order Id and Reply Date are removed since they will be assigned when task is completed (ApprovePurchase.wf)

<action type="Completed" name="Complete">
<changeVariables>
<copy>
<from>current-dateTime()</from>
<to>$TaskOutput.part1/po:replyDate</to>
</copy>
<copy>
<from>$TaskInput/po:orderId</from>
<to>$TaskOutput.part1/po:orderId</to>
</copy>
</changeVariables>
</action>

Figure-8 Xpath Xform-output

Xpath + Escalation +Notification enabled Purchase Order Sample

PurchaseOrderWorklistAppNotification builds adds Escalation and Notification on top of the previous 2 samples.

Escalation

In Figure-9 Escalation below, 1 Escalation is present, duration is 3 minutes starting from task creation, user 'dale' will be added to the assignees along with the original assignees when the task is escalated
(see http://wiki.open-esb.java.net/Wiki.jsp?page=WLMSE#section-WLMSE-TaskEscalation)
Figure-9 Escalation

Notification

Adding notification on task definition has 2 steps:
1. Add Notifications that defines who should be notified and what the email subject and body should look like
In Figure-10 Notification-notification below, 2 Notifications are configured, you can use xpath to add dynamic content from Task Input into Email Address, Subject and Body.
Figure-10 Notification-notification

2. Add Actions to refer to the Notifications created in 1 to tell when the Notification should be sent
In Figure-11 Notification-action below, Action Init (Type="Assigned") will do notifyUser and Action Complete will do notifyManager
Figure-11 Notification-action

Configure EmailBC for Notification

Once you added Notification, you need to configure EmailBC to use your server setting.
a. Open EmailNotificationHandler.wsdl in PurchaseOrderWorklistAppNotification, the EmailNotificationHandler.wsdl is added automatically when Notification is used. Configure the outbound EmailBC SMTPAddress below:
<service name="EmailNotificationHandlerService">
<port name="NotificationHandlerPortTypeBindingPort" binding="tns:NotificationHandlerPortTypeBinding">
<email:SMTPaddress location="mailto:someUser@localhost.com" emailServer="yourserver" useSSL="false" port="465" userName="yourusername" password="yourpwd"/>
</port>
</service>
Mandatory attributes: emailServer (the SMTP outbound server), useSSL, port, userName, password.

b. When you create a Composite Application and add the Worklist project and BPEL project into it, the CASA will automatically create links between WLM module and BPEL module and the emailPort and the outbound Email Port,
but it is always good to double check:

Notification CASA

LDAP + Xpath + Escalation +Notification enabled Purchase Order Sample

PurchaseOrderWorklistAppNotification_LDAP is a sample of using LDAP to do user authentication and obtain emails from LDAP for users and users' manager in Notification, please see details on Using LDAP

Instructions To Run Samples


Unless specified, the steps are the same for all samples

1. Log into admin console of Glassfish (Glassfish must be started first)

Figure-12 Glassfish-login

2. Create a new user under Configuration/Security/Realms/file by clicking on Manage Users.

Figure-13 Glassfish-Security-File-Realm

3. Create a new user as below and hit OK:

User ID : john
Group List : CustomerServiceRep
New Password: john
Confirm New Password : john
Figure-14 Glassfish-Security-Create-User

4. Clean, build and deploy WorklistWebCompositeApp (you may need to set server instance, please see Notes below)

Note

  • You should deploy WorklistWebCompositeApp and not WorklistWebApplication
  • You may need set server instance if you deploy this project the first time, right click on WorklistWebCompositeApp and open Properties, set glassfish instance in
Figure-15 Set Server Instance

5. Clean, build and deploy PurchaseOrderCompositeApp (you may need to set server instance, please see Notes below)

Note:
  • Always check the CompositeApp to make sure link exists to connect the provider and consumer between BPEL and WLM, the link should be created by CASA automatically once WLM module and BPEL module are added.
  • You may need set server instance if you deploy this project the first time, please see Figure-15
Figure-16 BPEL-WLM-Link

Note for Notification:
a. For notification emails to be sent, you will need to configure Email BC, please see Configure EmailBC for Notification
b. Change the Notification destination email addresses in PurchaseOrderWorklistAppNotification/src/ApprovePurchase.wf:
Figure-19 Change Email Addresses

6. Go to worklist web app at http://localhost:8080/WorklistWebApplication/wlm-jsp/wlmEntry.jsp and enter user john and password john

Figure-20 WLM Manager Console--Log In

7. You will see empty task list:

Figure-21 WLM Manager Console--Empty Task List

8. Now run SendExpensivePurchaseOrderTestCase in PurchaseOrderCompositeApp to create a task from a bpel process instance

Figure-22 Create task

Note:
The test case will not complete until user completes the task from the WLM Console, so it is OK that it times out.

9. You will note that worklist web app has a new task ( it is AJAX enabled )

Figure-23 Task List

10. Note the task is assigned to CustomerServiceRep as defined in ApprovePurchase.wf file,

since you are logged in as 'john' and 'john' is in the group 'CustomerServiceRep' (configured in file realm in Step (3)). You (or any one in the group) can see the task and claim this task.
You can click on task to see task details. It shows only task input details in generated Xform because the task is not checked out
Figure-24 Task Input

11. Click on checkout to checkout task. Note the Status becomes 'CLAIMED' and Claimed by is 'john'.

Figure-25 Task check out

12. Click on task again to see task details. This time, both task input and output details are shown in generated xform to allow you to enter output.

Select Approve add some description and hit submit (you will see “loading ...” on the right corner of the form till it is updated in the database) .
The output on the form contains the content you typed.
Figure-26 Task output

13. Click on complete button to complete the task and the task disappeared from the task list (without the need to refresh the page)

Figure-27 Completed Task

14. You can verify in the composite app tester output that a response is obtained which similar to what user submitted from the worklist web app, i.e.

The bp process instance receives the response from wlm and sends the response to complete the test case
Figure-28 Verify BPEL process output

How to customize web console and add users/groups for your environment


Please see Customize Web Console for details

Make your own Worklist Manager client application


Your can create your own worklist manager client application by invoking TaskCommonService provided by wlmse

1. Obtain TaskCommon.wsdl

Currently, TaskCommon.wsdl is not published on a URL, however, you can obtain it by doing a build on your worklist project and find it in the build folder, you can copy it into your WebApp project, the default WebApp retains a copy in web/WEB-INF/ folder
Figure-29 TaskCommon.wsdl

2. Make a concrete WSDL off TaskCommon.wsdl

TaskCommon.wsdl is an abstract wsdl without bindings and services, this is fine for JavaEE SE to talk to WLM SE, but JAXP can not generate classes based on this abstract wsdl.
You have 2 options to resolve it:
a. Create binding and service for the abstract TaskCommon.wsdl using WSDL Editor.
b. Get a copy of concrete TaskCommon.wsdl from the default web console WorklistWeb/WorklistWebApplication/web/WEB-INF/TaskCommon.wsdl.

3. Create web service client in your web application to invoke TaskCommonService in TaskCommon.wsdl

You may create the web service client using Netbeans (New --> Web Service Client), point to the TaskCommon.wsdl in the file system (it should reside in your web application project itself from Step 1)
Note:
a. You can specify package name and not using the wrapper by selecting the web service reference and
choose “Edit Web service attributes” from context menu (The sample uses this setting):
Figure-30 Edit TaskCommon.wsdl

b. Due to http://www.netbeans.org/issues/show_bug.cgi?id=146099, currently, the absolute file path of
wsdl file is referenced as –wsdllocation in wsimport when the project is built, it breaks the portability
when the project is moved from environment to environment.
A workaround is described below:


Open nbproject/jaxws-build.xml of your web project, find the target wsimport-client-TaskCommon and
change the value of the wsdlLocation to use a relative file path to point to an existing
TaskCommon.wsdl. You may copy the concrete TaskCommo.wsdl to your project and use ant task to copy the
file into build directory, please see in WorklistWebApplication/build.xml :

<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
<copy todir="${build.classes.dir}">
<fileset dir="${webinf.dir}" includes="TaskCommon.wsdl"/>
</copy>
</target>
This above task effectively copies the TaskCommo.wsdl from web/WEB-INF directly to build/classes
directory which is the top directory of all compiled java classes.
<wsimport xendorsed="true" package="com.sun.workflow.client" verbose="true"
sourcedestdir="${build.generated.dir}/wsimport/client" extension="true"
destdir="${build.generated.dir}/wsimport/binaries" wsdl="${basedir}/${conf-dir}xml-resources/webservice-
references/TaskCommon/wsdl/TaskCommon.wsdl"
wsdlLocation="../../../../TaskCommon.wsdl" catalog="catalog.xml" />
The wsdlLocation points to the file just copied into build/classes. This file will be referenced to at runtime.
Currently, due to https://glassfish.dev.java.net/issues/show_bug.cgi?id=6810, a workaround has to be
made to make the web component serving as web service client work. Please look at nbproject/jaxwsbuild.xml,
modify the ant target accordingly in your project:
<target name="wsimport-client-compile" depends="-pre-pre-compile">
<replace file="${build.generated.dir}/wsimport/client/com/sun/workflow/client/TaskCommonService.java">
<replacetoken><![CDATA[baseUrl = com.sun.workflow.client.TaskCommonService.class.getResource(".");]]></replacetoken>
<replacevalue><![CDATA[baseUrl = com.sun.workflow.client.TaskCommonService.class.getResource(".");
if (baseUrl == null) {
baseUrl = com.sun.workflow.client.TaskCommonService.class.getResource("");
}]]></replacevalue>
</replace>
<webproject2:javac srcdir="${build.generated.dir}/wsimport/client" classpath="${j2ee.platform.wsimport.classpath}:${javac.classpath}" destdir="${build.classes.dir}"/>
</target>
c. In nbproject/jaxwsbuild.xml, make sure taskdef wsimport has correct class path specified, keep the below 2 path elements and remove any others if they appear, otherwise, it may not work for JDK 6.
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" >
<classpath path="${java.home}/../lib/tools.jar:${j2ee.platform.wsimport.classpath}"/>
</taskdef>

4. Do a clean build to generate classes, the client stub classes will be generated in build/generated/wsimport folder.

5. Use the generated classes in your web application to invoke operations on TaskCommon.wsdl,

WorklistWeb\WorklistWebApplication\web\wlm-jsp\getTaskList.jsp is an example of using the generated class to invoke an operation on TaskCommon.wsdl

6. Create a composite App and add your web application into it.

7. In the created compositeApp, add an External Service Unit: WLMSE-TaskCommon

Figure-31 External Service Unit

8. Type Interface Name, Service Name, Endpoint Name for WLMSE-TaskCommonPort as below:

Figure-32 WLMSE-TaskCommonPort--Interface

Figure-33 WLMSE-TaskCommonPort--Service

Figure-34 WLMSE-TaskCommonPort--EndPoint

9. Disable the TaskCommonPort on the LEFT WSDL Ports section because TaskCommonPort is not exposed as http soapBC

Figure-35 WLMSE-TaskCommonPort

10.Connect WLMSE-TaskCommonPort with javaee-TaskCommonPort

Figure-36 WLMSE-TaskCommonPort

11.Build and Deploy the Worklist Composite App

Create Task Definition From Scratch


There are 2 ways of creating Task Definition files, one is using a WSDL file that is already created and the other is create the task definition when you are creating the BPEL process.

We are going to describe them in details below.

Method 1: Create Worklist Project with WSDL

1. Create Worklist Project Or use an existing Worklist Project :

File --> New Project --> SOA --> Worklist Module: Create a new Worklist Project

2. Create an abstract WSDL file (and related xsd for imports) that defines the Input and Output of the Task.

Note:
For this WSDL, no need to define Bindings and Services, an abstract WSDL is sufficient because it is only invoked by BPEL.
e.g.

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="ApprovePurchase_TM_BPEL" targetNamespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL"
xmlns:ns1="urn:WS/types"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:po="http://wlmse.sample1/po" xmlns:plink="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:tns="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL" xmlns:ns="http://wlmse.sample/po">

<!-- Type definitions -->
<types>
<xsd:schema targetNamespace="http://jbi.com.sun/wfse/wsdl/WorkflowApp2/ApprovePurchase_TM_BPEL">
<xsd:import schemaLocation="PurchaseOrder.xsd" namespace="http://wlmse.sample/po"/>
</xsd:schema>
</types>
<message name="TaskInput">
<part name="part1" element="ns:purchaseOrder"/>
</message>
<message name="TaskOutput">
<part name="part1" element="ns:orderReply"/>
</message>
<portType name="ApprovePurchasePT">
<operation name="ApprovePurchase">
<input name="ApprovePurchaseInput" message="tns:TaskInput"/>
<output name="ApprovePurchaseOutput" message="tns:TaskOutput"/>
</operation>
</portType>
</definitions>
3. Create a new Worklist Task Definition

New File --> SOA --> Worklist Task Definition
Type in File Name and select the Operation using the WSDL you created in 2.
Click Next
Type User(s) and/or Group(s)
Click Finished

4. Title and Priority
A Design view of the Task Definition will be opened, type in a String for Title and a number ( 1 -- 10, 10 is the highest) for Priority

5. Add Escalation (Optional)
Go to Escalations tab and add one or more Escalations, select Duration or Deadline and add User(s)/Group(s) where you want the escalated task to go. Please see details on Escalation

6. Add Notification (Optional)
Go to Notifications tab and add one or more Notifications. Please see details on Notification

7. Add Init and Action (Optional)
Init:
You will need Init if you want to have some default value for the Task output when it is presented to the user.

Action:
You will need Action if you have one of the following requirements :
a. You have defined Notification(s), you will need Action(s) to trigger the Notification(s) based on the status of the task, described in details on Notification
b. You need to change/assign some value in the Task Output when its status is changed, the most common use is when the task is completed, a timestamp is assigned to the task output.

Mapper is used in both Init and Actions for variable copy and xpath construction. If you use Actions, you will first define Actions and then use Mapper to create variable assignment in the Actions by choosing an Action name from the Context drop-down box.
Please see details on Init and Action

8. Use Xpath in Task Definition (Optional)

Currently, Mapper is supported in variable copy/assignment in Init and Actions, but in fact, you can use xpath to extract value from Task Input and use in almost everywhere, these fields are xpath enabled:
Title, Priority, Assignment/User, Assignment/Group, Escalation/Duration, Escalation/DeadLine, Escalation/Assignment/User, Notification/Email-Address, Notification/Subject, Notification/Body.

In the future, Mapper will be used to construct xpath in the above fields, currently, user needs to type "=" as prefix to indicate it is an xpath input. See details on Xpath

Method 2: Create Task Definition when creating the BPEL process (Pending)

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-176) was last changed on 02-Nov-09 07:40 AM, -0800 by MeiWu