2 Replies Latest reply on Jul 5, 2007 10:02 AM by clause Mbacky

    get a token in another task

    clause Mbacky Newbie

      Hi everybody .
      I have a problem to go to next task-node with jbpm in a web application by using struts.

      i did a small process like this:

      start
      task1
      task2
      end


      On my first bean in strut, i deploy process and i go to the first task.
      But when i write this in order to go to the next task:


      TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();

      TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(1);
      taskInstance.setActorId(jbpmContext.getActorId());
      taskInstance.start();

      Token token = graphSession.loadToken(1);
      Transition transition=null;
      String transitionName=null;

      if (token.getNode().getLeavingTransitions().isEmpty() == false) {
      Iterator availableTransitionsIterator = token.getNode().getLeavingTransitions().iterator();
      while (availableTransitionsIterator.hasNext()) {
      transition = (Transition) availableTransitionsIterator.next();
      }
      transitionName=transition.getName();
      }

      token.signal(transitionName);
      ProcessInstance processInstance = token.getProcessInstance();

      jbpmContext.save(processInstance);


      there are an error :

      Integrity constraint violation - no parent FK_TASKINST_TASK table: JBPM_TASK in statement [insert into JBPM_TASKINSTANCE (NAME_, DESCRIPTION_, ACTORID_, CREATE_, START_, END_, DUEDATE_, PRIORITY_, ISCANCELLED_, ISSUSPENDED_, ISOPEN_, ISSIGNALLING_, ISBLOCKING_, TASK_, TOKEN_, SWIMLANINSTANCE_, TASKMGMTINSTANCE_, CLASS_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', null)]


      what's this error means ?
      i think it can't execute
      *.signal()
      why ?

      Please I need your help !!!