TaskInstance taskInstance = (TaskInstance) processInstance.getTaskMgmtInstance() .getTaskInstances().iterator().next();
But it doesn't work.
when i do
System.out.println("Size of TaskList " + processInstance.getTaskMgmtInstance().getTaskInstances().size());
the size is 1 and not 3.
I don't understand.
those tasks are assigned to different users.
i've also used
but it doesn't work.
I resolved the problem.
The solution is
simple you do not transition to tasks but to task nodes.
e.g. to='task2' should be to='task-node2'
and pay attention to capitalization
you're right kukeltje. But, the solution for my problem is still the one that i said.
If you want to iterate over unfinished tasks just for that processinstance you are correct.
I've changed the code, and the problem has appeared again.
To change through Task-nodes, saying
If i try to use
taskInstance = (TaskInstance) iterator.next();
to call the next task-node, the program simply blows up. I get this exception:
java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$KeyIterator.next(Unknown Source) at com.sample.WorkFlow.ListaTarefasTask(WorkFlow.java:83) at com.sample.Starter.main(Starter.java:11) Exception in thread "main"