" </task-node>" +
" <end-state name='end' />" +
"</process-definition>"
);
ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("testSwimlanePoolReassignmentOfTakenTask");
processInstance.signal();
processInstance = saveAndReload(processInstance);
TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
SwimlaneInstance swimlaneInstance = taskMgmtInstance.getSwimlaneInstance("hero");
TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next();
changeNappy.setActorId("should-be-one-of-the-actors-in-the-pool-but-doesnt-have-to");
assertEquals("should-be-one-of-the-actors-in-the-pool-but-doesnt-have-to", changeNappy.getActorId());
assertEquals(3, changeNappy.getPooledActors().size());
assertEquals(changeNappy.getPooledActors(), swimlaneInstance.getPooledActors());
changeNappy.end();
processInstance = saveAndReload(processInstance);
taskMgmtInstance = processInstance.getTaskMgmtInstance();
swimlaneInstance = taskMgmtInstance.getSwimlaneInstance("hero");
TaskInstance makeBottle = (TaskInstance) taskMgmtInstance.getUnfinishedTasks(processInstance.getRootToken()).iterator().next();
assertEquals("should-be-one-of-the-actors-in-the-pool-but-doesnt-have-to", makeBottle.getActorId());
assertEquals(3, makeBottle.getPooledActors().size());
assertEquals(makeBottle.getPooledActors(), swimlaneInstance.getPooledActors());
}