Working with OpenESB WLMSE

Overview


Here we will attempt to create simple Application that demonstrate use of WLM Application.

Before we begin, quick introduction to WLM is appropriate. WLM stands for Worklist Manager. It allows you to create Web Service Application that require human action/decision (one of pre-defined options) based upon some input data. So, in nutshell, the WLM application can be fed messages (predefined type) and exposes some API’s (can be used to build Web Interface) that allows assigned user’s to see the requests as list of tasks for some actions/decisions. The resulting choice of the user will be sent back as output message (again pre-defined type) to calling service. The service interface is defined using WSDL and the communication is Synchronous.

WLM application can be best thought of means to incorporate human step in an automated process. For example, if you need to incorporate human approval step in you BPEL Process, you can achieve this using WLM Application. It also provide features such as Task Escalation, Notification etc. This is what we are going to do in this Helloworld Application.

A WLM Application has three components:

Please refer to Downloadsclip_image001 for required components download

Design Time

You can use Netbeans (download pageclip_image001[1]) with SOA Modules and create WLM Project type. Using worklist editor, you create task definition wherein the aspects about the task definition is specified. More on this later.

Runtime

The built project is deployed on Glassfish with JBI Runtime Environment. Project Open-ESB provides a Service Engine called sun-wlm-engine which provide runtime implementation for WLM Projects.

Web Application

The Users of the Task can log on to Web Console and view and complete the tasks assigned to them. Good news is that project Open-ESB contains a starter Web Application that can be used as starting point and customized based on specific requirement. We will be using this Web Application for this Helloworld Application.

Project Description

For demonstration purpose , I am going to create a sample project for issue Management , Whenever we have Issue in our production server we would want to follow certain process (like notification , escalation ,assignment to particular group )to take care production issues efficiently . We can implements these processes using WLMSE.

BPEL Process:

  1. Receive Service Request from Reporter
  2. If Issue Environment is production then request will be forwarded to WLM service
  3. If the Request any other environment then Bpel will be taking care of it.

WLM Application:

  1. We will define a Task Service which can take a message of Issue management .
  2. We will define the user group (production_support Type) who can work on this task.
  3. The task outcome message will be sent back to the calling process (BPEL Application)

Web Application:

  1. Anyone from production_support can log on to the web application
  2. Accept the task
  3. Post the outcome of the task on the Web Application to send the response back to the BPEL Process

Create WLM Project

Step 1:
Create New WLM Project.( IssueManagementWLMSEProj)

New projectà SOAàWorklist Module

clip_image003

Step 2:
Create Schema – Define the message structures

clip_image005

clip_image007

Step 3:
Create WSDL Document for WLM Service – Create a Request-Response WSDL Document

Use , IssueRequest as Input Message and IssueResponse as Output Message.

clip_image009

Step 4:

Now In case Issue Environment is Production we would like to follow certain protocol (such as assigning to particular group , escalation and notification) which will be taken care by WLMSE.Lets begin with it .
In this Tutorial we will be doing just assigning to particular group say” production_support” . Escalation and notification will be covered in next tutorial.

Create Task Definition (wf file) – Define the rules regarding the authorized users.

clip_image011

Select Operation from IssueManagementWS.

clip_image013

àAssign Group to “production_support”

clip_image015

clip_image017

Step 5:
Build the WLM Application. You will notice that one additional file
IssueManagementTaskDefn.xhtml is getting generated. XForm clip_image001[2]is
used to dynamically generate the web form – based on the task message schema,
that will be presented when the authorized user logs into the Web Application.

if you do not see XForm generated fter building the project. Please check build-impl.xml if you do not see generate-xform in target node then add it and build the project again.

clip_image019

Notes:
– You can edit the form for custom design and prettying it up.
– Successive builds will not change once generated xform. So, if you are making changes to the schema,
you would need to delete the generated xhtml file for generating updated one.

Create BPEL Project.

Business Process

We will not get into details of how to create a Business Process. You can refer this pageclip_image001[3] for getting started with BPEL. Here the steps for creating BPEL Module for this project.

  1. Create a Schema Definition File that defines the input message structure for the Process.

clip_image021

  1. Create a WSDL Document that defines the input message part of the type as defined in schema above. Drag this WDSL Document and drop on the left swim lane, to configure the partnerlink (for handling customer request).

clip_image023

  1. Drag the WSDL from the WLM Service (see WLM Module above) and drag it over the right swim lane. Configure the partnerlink for the WLM Service invocation.

clip_image025

Create Composite Application

Add Bpel project and Wlm project to CASA and build the project.

clip_image027

WLM-Console

To Install and Deploy the Worklist Manager Console Sample

1. Right-click in the NetBeans Projects window, and select New Project.

The New Project Wizard appears.

2. Under Categories, expand Samples and then select SOA.

3. Under Projects, select WLM Console.

4. Click Next.

5. Enter a name for the project, and then click Finish.

Two new projects appear in the projects tree. One is the Worklist Manager Console web project, and the other is the composite application for the console.

6. Make any necessary security changes to the console.

Configure Authorization:

The worklist task definition authorizes users of type – production_support- to access the task list. You need to specify this group type for the worklist web application in the descriptor file (web.xml and sun-web.xml) of the web application. The following specifies the authorized users and maps them to the group name defined in the Glassfish Application Server Security Configuration.

Add following configuration to xmls.

sun-web.xml

<security-role-mapping>

<role-name>production_support</role-name>

<group-name>production_support</group-name>

</security-role-mapping>

Web.xml

<security-role>
    <role-name>production_support</role-name>
</security-role>
<auth-constraint>
    <role-name>production_support</role-name>
</auth-constraint>
Create a new user under Configuration/Security/Realms/file by clicking on Manage Users
clip_image029
clip_image030

7. Clean and build the web project and then the composite application project.

8. Deploy the composite application project.

Testing sample project.

1) Open SOAP UI , Create new project with your Bpel Ws as request .

clip_image032

2)Open WLM-Console using url : http://localhost:{http port}/wlm-sample/index.jsp

1.Login with userid/password which we created under production_support group earlier .

2) Once login success you will all task assigned for group “ production_support” appearing under “All Task” .

a)

clip_image034

b)Click on task.

clip_image036

c)Claim the task. Click on claim.

Give output message and Click on save and complete.

clip_image038

d) Click on my task you will find all the task you have been working or have completed earlier .

clip_image040

Issue with Wlm-Console

Note: WLM-Console does not work with OpenEsbv2.3 metro version. (JAXWS 2.25)

After Login if you do not see task appearing, Please check glassfish metro version.

clip_image041

Currently With OpenEsb2.3 metro version Wlm-console is not working , you are likely to get following error.

No payload. Expecting payload with

{http://jbi.com.sun/wfse/wsdl/TaskCommon}

GetTaskListResponse element
javax.xml.ws.WebServiceException: No payload. Expecting payload with

{http://jbi.com.sun/wfse/wsdl/TaskCommon}

GetTaskListResponse element
at com.sun.xml.ws.client.sei.ResponseBuilder$RpcLit.readResponse(ResponseBuilder.java:642)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:125)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:144)
at $Proxy107.getTaskList(Unknown Source)
at com.sun.glassfishesb.wlm.console.TaskListPage.fetchTasks(TaskListPage.java:295)

This is basically because of Incompatibility between sun-javaee-engine and JAXWS 2.2.5 .Refer to this link to get complete information for this issue. https://openesb.atlassian.net/browse/ESBCOMP-26

If you are using OpenEsb2.2 WlmSE /Wlm-console works fine but with OpebEsb2.3 Wlm-Console having above issue To make WlmSE work we need to use JAXWS 2.1 version. For that you need to change following jar from glassfish lib folder. (you can also use below jar from openEsbv2.2 which having 2.1.1 metro version)

1) webservices-tools.jar

2) webservices-rt.jar

3) webservices-api.jar (/lib/endorsed/)

References:-

1) http://wiki.open-esb.java.net/Wiki.jsp?page=WLMSE

2) http://docs.oracle.com/cd/E19182-01/821-0871/ug_wmlse-tasks_p/index.html

Submit a Comment