loger.severe("User: " + user.getLogin() + " attempting to reassign task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " to user: " + userLogin);
ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
pi = getProcessData(pi.getInternalId(), ctx);
ProcessEngine processEngine = getProcessEngine(ctx);
TaskService ts = processEngine.getTaskService();
Task task = ts.getTask(bpmTask.getInternalTaskId());
if (nvl(userLogin,"").equals(nvl(task.getAssignee(),""))) {
loger.severe("User: " + user.getLogin() + " has not reassigned task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " as the user is the same: " + userLogin);
return;
}
//this call should also take care of swimlanes
ts.assignTask(bpmTask.getInternalTaskId(), userLogin);
fillProcessAssignmentData(processEngine, pi, ctx);
loger.info("Process.running:" + pi.getRunning());
ctx.getProcessInstanceDAO().saveProcessInstance(pi);
loger.severe("User: " + user.getLogin() + " has reassigned task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " to user: " + userLogin);