2 Replies Latest reply on Jan 9, 2009 4:38 AM by Ronald van Kuijk

    unable to do graph navigation in jbpm using token.signal or

    ws dev Newbie

      Hi All,
      I have a process definition with a start state, end-state and a node in between. I have configured actionhandlers for the start state , node and the end

      state. i am using the jbpm exceutioncontext from the execute() method to advance the token using either :

      a) context.getNode().leave(context, namedTransition);

      or
      b) context.getToken().signal(namedTransition)

      in the second case i am explicitly unlocking the current node using the token id as below:
      long tokenId = context.getToken().getId();
      Token currentToken = context.getToken();

      if(currentToken.isLocked()) {
      currentToken.unlock("token[" +new Long(tokenId).toString()+"]");
      }



      the events which i am checking for are node-enter and node-leave events in the execute method which I am overriding in my ActionHandlers configured for these

      nodes.
      start-state = node-leave
      node = node-enter and node-leave
      end-state = node-enter


      start-state ---transition1---> node1 ---transition2 ----> end-state

      For the above scenario everything works as expected.

      However if i introduce one more node between the start and end states :
      start-state ---transition1---> node1 ---transition2 ----> node2 ----transition3----> end-state

      the process instance doesnt complete and in one case returns the token to the first node and in another returns the token to the second node. Thus the

      process instance wont complete unless i explicitly keep calling the token.signal(transition) or the node.leave(transition) as stated above.

      Can anyone help me resolve this ? I have tried task-nodes as well but the behaviour is erratic.
      Is there something in the API I am missing ?

      TIA