Saturday, May 25, 2013

Escalating a human task with WSO2 BPS.

This Post describes, how to you can define a deadline within a human task. For this I am going to extend WSO2 BPS Claim Approval Task sample.

Prerequisite

  • If you haven't tried the sample yet, try it first. So you get better idea about how human task works.
  • Download WSO2 BPS 3.0.0 +
  • an Text Editor.

Note: You can find more information about humantask deadlines and timeouts under section 4.9 in humatask specification. 

What I am going to do in this sample ...

In this sample, I have set deadline time duration for 5 minuets after task creation. The escalation is defined such a way that, if the claimed amount is less than 10000 and task not started within 5 minutes, then notify task's potential owners that current claim approval task is overdue.

Steps to Modify WSO2 BPS Claim Approval Task sample


1)  Setup BPS as mentioned in sample page.

Deploy BPEL package. Creates Roles and Users. But do not deploy humantask package ClaimsApprovalTask.zip since we are going to modify it in next steps.

2) Modify ClaimsApprovalTask.ht

Unzip ClaimsApprovalTask.zip and Add following deadline definition (i.e <htd:deadlines>) inside ApproveClaim task definition (i.e. <htd:task "ApproveClaim"> ) in ClaimsApprovalTask.ht


3) Replace ClaimsApprovalTaskService.wsdl

I did slight changes to wsdl file for this sample. So replace ClaimsApprovalTaskService.wsdl with this file.

4) Deploy Sample

Create new zip file including all files.(modified and unmodified) and deploy it in BPS.
( you can find modified sample from here )

5) Send a Sample Request.

After deployment, send a sample request (like given in sample page). You can see task is created under clerk login. Do not start the human task.

6) Wait 5 mins.

After 5 mins, deadline will be executed. As a result this, a notification is generated and sent to the clerk. Clerk can view notification under Home -> Human Tasks -> Notifications.