0 Replies Latest reply on Jun 15, 2007 4:30 AM by Bill Pattchen

    End a path of execution

    Bill Pattchen Newbie

      hi,
      I would like to know how to end a path of execution in jBPM. In fact, i have a path of execution which should end if a certain condition is evaluated to true, so that others activities will not take place.

      I've tried these solutions:
      1.

      if(condition){
       executionContext.getToken().end;
      }
      else{
      executionContext.leaveNode();
      }


      2.
      if(condition){
       Node endNode = executionContext.getProcessDefinition().findNode("end");
       executionContext.getToken().setNode(endNode);
      }
      else{
      executionContext.leaveNode();
      }


      3.
      if(condition == false){
      executionContext.leaveNode();
      }


      all work, but I feel that there is a difference because solutions 1 and 2 explicitly end the path of execution while the third just behaves as a state node.

      Can someone explain me the difference, and which is the right solution to resolve my problem?

      Thanks.