micky0
micky0

Reputation: 1

jbpm6 the actors of user task

I make new jBPM Process with "a more advanced process including human tasks and persistence". Then run the process ,everything is fine. But if I change the actor of user task,for example, I change “mary” to “may” on Task 2

,a error will happen,the list’s size is 0.

    // let john execute Task 1
    List<TaskSummary> list = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
    TaskSummary task = list.get(0);
    System.out.println("John is executing task " + task.getName());
    taskService.start(task.getId(), "john");
    taskService.complete(task.getId(), "john", null);

    assertNodeTriggered(processInstance.getId(), "Task 2");

    // let mary execute Task 2
    list = taskService.getTasksAssignedAsPotentialOwner("may", "en-UK");
    System.out.println("list.size:"+list.size());
    task = list.get(0);
    System.out.println("May is executing task " + task.getName());
    taskService.start(task.getId(), "may");
    taskService.complete(task.getId(), "may", null);

then a error will happen,the console shows that the list's size is 0. Can anyone help me?

Upvotes: 0

Views: 1368

Answers (3)

Ino
Ino

Reputation: 21

Did you add the new user 'may' to UserGroupCallback?

Upvotes: 0

salaboy
salaboy

Reputation: 4143

That's the expected behaviour.. if your processes create tasks for Mary but you query the tasks for May, it will return 0 tasks for May. Then the rest of the lines will fail.

Upvotes: 0

Related Questions