This content has been marked as final.
Show 1 reply
-
1. Re: how to know the state running of the process?
michaelholtzman Oct 6, 2006 11:50 AM (in response to psurian)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.