0 Replies Latest reply on Aug 22, 2007 10:04 AM by Ricardo Marques

    assigning user to taskinstance, does nothing

    Ricardo Marques Novice

      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;
       }
      



      This code is called like this:

      Command cmd = new AssignUserToTaskCommand(taskInstanceId,username);
      engine.execute(cmd); // -> this calls the command.execute()
      



      my phase listenner:

      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();
       }
      
       }
      
      



      Jbpm: 3.2.1
      mysql 5
      Jboss 4.0.5


      I appreciate some feedback on this please, thanks.