-
1. Re: Human task escalation understanding
swiderski.maciej Feb 8, 2013 2:07 PM (in response to javajbpmuser)1 of 1 people found this helpfulthis is according to WS-HT specification that says that task should be set to Ready state after reassignment. As that allows to be claimed by all potential owners defined. See WS-HT spec section 4.9.
HTH
-
2. Re: Human task escalation understanding
javajbpmuser Feb 13, 2013 5:55 AM (in response to swiderski.maciej)Hi Maciej
thanks for the quick reply and for the help.
Actually I saw WS-HT specification, it says that after reassignment the task status changes from Reserved to ready and so the task could be claimed by on of the declared as potentiel owners or groups.But the limitation is when task is reassigned ,the only way to notify for that change is to send an e-mail.
In fact ,I would like to know if there any way to call a custom java service or method when the task is reassigned ( status changes from reserved to ready).that why I am asking if it is possible to catch the event that is responsible for changing task status after timeout.
Regards
-
3. Re: Human task escalation understanding
javajbpmuser Feb 20, 2013 11:00 AM (in response to javajbpmuser)Hi all,
Is there any help on my previous question.
Thanks in advance.
-
4. Re: Human task escalation understanding
eaa Mar 18, 2013 1:32 PM (in response to javajbpmuser)It seems you will need to hack your own solution. The class in charge of deadlines and escalation is: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/task/service/DefaultEscalatedDeadlineHandler.java
Starting from line 187 is where the escalation logic takes place.
It would be good to have a pluggable mechanism to add custom logic here. Something similar to WIHandlers, but for the HT server.
Best Regards,
-
5. Re: Human task escalation understanding
eaa Mar 18, 2013 1:38 PM (in response to eaa)Good news is that it seems the pluggable mechanism is already there: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-war/src/main/java/org/jbpm/task/servlet/HumanTaskServiceServlet.java
You could implement your own solution using the code of DefaultEscalatedDeadlineHandler and adapt it to your needs.
Best Regards,
-
6. Re: Human task escalation understanding
javajbpmuser Mar 20, 2013 11:41 AM (in response to eaa)Hi Esteban,
Thanks a lot for your reply.
It is definitely provides me the solution how to customize escalation event . Actually here is the solution I set up according to what you explained before , it is working fine and I am giving the java code that can help other members to define quickly a customized escalation.
Just for information , I do not use the Servlet HumanTaskServiceServlet in my application as mechanism for plugging cutomized task service.
Actually I am using spring configuration on my application , so at startup I am creating the task service using the code below :
public void initialize(){
MyOwnEscalationHandler Myhandler = new MyOwnEscalationHandler();
taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener(),Myhandler);// register my handler in the task service
}
The class MyOwnEscalationHandler is the following
public class MyOwnEscalationHandler implements
EscalatedDeadlineHandler {
@Override
public void executeEscalatedDeadline(Task task, Deadline deadline,
Content content, TaskService service) {
// TODO Auto-generated method stub
if ( deadline == null || deadline.getEscalations() == null) {
System.out.println("**********No escalation detected**********");
return;
}
for ( Escalation escalation : deadline.getEscalations() ) {
System.out.println("Deadline detected processing action ");
System.out.println("The task has expired , I am executing my own Deadline handler**********");
// we won't impl constraints for now
//escalation.getConstraints()
// run reassignment first to allow notification to be send to new potential owners
if ( !escalation.getReassignments().isEmpty()) {
// get first and ignore the rest.
Reassignment reassignment = escalation.getReassignments().get( 0 );
task.getTaskData().setStatus( Status.Ready );
List potentialOwners = new ArrayList( reassignment.getPotentialOwners() );
task.getPeopleAssignments().setPotentialOwners( potentialOwners );
task.getTaskData().setActualOwner(new User("Administrator"));
}
for ( Notification notification : escalation.getNotifications() ) {
System.out.println("****** Notify by emaill**********");
}
}
deadline.setEscalated( true );
}
}
Best regards,
-
7. Re: Human task escalation understanding
crasybpm Jul 28, 2013 5:45 AM (in response to javajbpmuser)Hello, Thanks a lot for your post and code snippest. i used this into my example its working but its failed to remove task from dashboard who escalated it. My requirment is 1) User1 is assigned task with name task1 and if its not completed within 60s it will reassigment to user2. I have implement you code in my example and code is esaclating but same time it is appearing in user1 dashboard as well as user2 dashboard. please help thanks in advance. Regards, crasybpm