jBPM6 - HumanTask's status doesn't change after being started nor completed
jizuzqui Oct 16, 2015 6:30 AMHi,
I'm trying to execute a simple workflow as a Java Application with jBPM 6.2.0-Final. The workflow is as it follows:
The first HumanTask is assigned to an actor called "tecnico1". After "tecnico1" completes his task, the second task is assigned to a second actor, "aprobador". Here is the java code for this workflow:
// Task 1: Product Definition
List<TaskSummary> listaActor1 = taskService.getTasksAssignedAsPotentialOwner(actor1, "");
System.out.println(actor1 + " has " + listaActor1.size() + " assigned tasks");
TaskSummary task = listaActor1.get(listaActor1.size() - 1);
System.out.println(actor1 + " claims the task " + task.getName() + ". The task status is " + task.getStatus().name());
taskService.claim(task.getId(), actor1);
System.out.println(actor1 + " has received the task " + task.getName() + ". The task status is " + task.getStatus().name());
taskService.start(task.getId(), actor1);
System.out.println(actor1 + " has started the task " + task.getName() + ". The task status is " + task.getStatus().name());
taskService.complete(task.getId(), actor1, null);
System.out.println(actor1 + " has completed the task " + task.getName()
+ ". The task status is " + task.getStatus().name() + ". The task owner is "
+ task.getActualOwnerId());
// Task 2: Product Approval
List<TaskSummary> listaActor2 = taskService.getTasksAssignedAsPotentialOwner(actor2, "");
System.out.println(actor2 + " has " + listaActor2.size() + " assigned tasks");
task = listaActor2.get(listaActor2.size() - 1);
System.out.println(actor2 + " has received the task " + task.getName() + ". The task status is " + task.getStatus().name());
taskService.start(task.getId(), actor2);
System.out.println(actor2 + " has started the task " + task.getName() + ". The task status is " + task.getStatus().name());
taskService.complete(task.getId(), actor2, null);
System.out.println(actor2 + " has completed the task " + task.getName()
+ ". The task status is " + task.getStatus().name() + ". The task owner is "
+ task.getActualOwnerId());
ksession.fireAllRules();
Here is the output log:
tecnico1 has 1 assigned tasks
tecnico1 claims the task Definicion producto. The task status is Ready
tecnico1 has received the task Definicion producto. The task status is Ready
tecnico1 has started the task Definicion producto. The task status is Ready
tecnico1 has completed the task Definicion producto. The task status is Ready. The task owner is null
aprobador has 1 assigned tasks
aprobador has received the task Aprobacion Producto. The task status is Reserved
aprobador has started the task Aprobacion Producto. The task status is Reserved
aprobador has completed the task Aprobacion Producto. The task status is Reserved. The task owner is aprobador
¿Is it correct? I thought that task status should change...
Source project is attached.
Thank you!
-
TallerProductosBPM-REST.zip 118.0 KB