[jboss-user] [JBoss jBPM] - Re: how to know the state running of the process?

michaelholtzman do-not-reply at jboss.com
Fri Oct 6 11:50:09 EDT 2006


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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976629#3976629

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976629



More information about the jboss-user mailing list