I have a process
(start) ---> [Human Task 1] -----> [Human Task 2] ----> [Human Task 3] ----> (End)
Here are the steps in my program.
1. Starting the process is no problem
ksession.startProcess("humanTaskFlow", params);
2. Looking for the task is no problem too
List<TaskSummary> taskSummaryList = localTaskService.getTasksAssignedAsPotentialOwner(actor, "en-UK");
3. Starting the task is no problem
localTaskService.start(taskSummary.getId(), actor);
4. Completing the task is no problem
localTaskService.complete(taskSummary.getId(), actor, contentData);
2. Looking for next task GOT PROBLEM. :(
List<TaskSummary> taskSummaryList = localTaskService.getTasksAssignedAsPotentialOwner(actor, "en-UK");
5. Dispose knowledge session
My logic is like this:
step 1
while(has_more_task) {
step 2
step 3
step 4
}
step 5
The result is [Human Task 1] started and completed. Then the program jump to step 5 and exit. But when I check the database, [Human Task 2] was created and at 'Reserved' state.
I changed my logic to:
step 1
while(has_more_task) {
step 2
step 3
step 4
Thread.sleep(1000);
}
step 5
and I can run through all the Human Tasks.
Am I doing something very stupid here??? :((