1 Reply Latest reply on Oct 6, 2006 11:50 AM by Michael Holtzman

    how to know the state running of the process?

    Pascal Surian Newbie

      Hello,

      My process definition is well done and the process runs perfectly.

      But the run take a long time and I would like to know in which state (node) my process is, at one time of the execution ?

      Thank for your help.

      Pascal

        • 1. Re: how to know the state running of the process?
          Michael Holtzman Newbie

          Off the top of my head ....

          public Vector processState(ProcessInstance pin) {
           Vector v = new Vector();
           Token root = pin.getRootToken();
           v.add(root.getNode().getName();
           childStates(root, v);
           return v;
          }
          
          public void childStates(Token token, Vector v) {
           if (token.hasActiveChildren()) {
           Map children = token.getActiveChildren();
           if (children != null) {
           Collection kids = children.values();
           if (kids.size() > 0) {
           for (Iterator it = kids.iterator(); it.hasNext();) {
           Token tok = (Token)it.next();
           v.add(tok.getNode().getName());
           }
           }
           }
          }
          


          You can, of course, collect any token information of interest and stick it in whatever object is appropriate.