Hi guys
I'm trying to reassign a task instance to a new user, but i can't, the information don't get saved on database, and i get no error output, i think that's some with the way that the connection to the engine is made.
I open a connection when the first JSF phase begins and ended when the JSF las phase ends.
were are some code:
Code from my Command interface implementation:
public Object execute(JbpmContext jbpmContext) throws Exception { /* Verify if all the needed attributes are set */ if ((this.taskInstanceId == 0) || (this.username == null)) throw new NotSetWorkflowException("missing required command attributes!"); /* updates the task instance with new actor */ TaskInstance taskInstance = jbpmContext.getTaskInstanceForUpdate(this.taskInstanceId); taskInstance.setActorId(username,true); return taskInstance; }
Command cmd = new AssignUserToTaskCommand(taskInstanceId,username); engine.execute(cmd); // -> this calls the command.execute()
public void beforePhase(PhaseEvent phaseEvent) { if (phaseEvent.getPhaseId() == PhaseId.RESTORE_VIEW) { getJbpmEngine(phaseEvent).openJbpmContext(); } } public void afterPhase(PhaseEvent phaseEvent) { if (phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE) { getJbpmEngine(phaseEvent).closeJbpmContext(); } }