// TODO: Change timers too!
// change tasks
Iterator iter = getTasksForToken(token).iterator();
while (iter.hasNext()) {
TaskInstance ti = (TaskInstance) iter.next();
Task oldTask = ti.getTask();
// find new task
Query q = jbpmContext.getSession().getNamedQuery("TaskMgmtSession.findTaskForNode");
q.setString("taskName", oldTask.getName());
q.setLong("taskNodeId", newNode.getId());
// TODO: q.setLong("processDefinitionId", newDef.getId());
Task newTask = (Task) q.uniqueResult();
if (newTask == null) {
throw new JbpmException("node '" + newNode.getName() + "' has no Task configured! Check the new process definition");
}
ti.setTask(newTask);
log.debug("change dependent task-instance with id " + oldTask.getId());
}
// change childs recursive
Iterator childIter = token.getChildren().values().iterator();