/** * looks up the token in the tree, specified by the slash-separated token path. * * @param tokenPath is a slash-separated name that specifies a token in the tree. * @return the specified token or null if the token is not found. */ public Token findToken(String tokenPath) { return rootToken != null ? rootToken.findToken(tokenPath) : null; }
/** * looks up the token in the tree, specified by the slash-separated token path. * * @param tokenPath is a slash-separated name that specifies a token in the tree. * @return the specified token or null if the token is not found. */ public Token findToken(String tokenPath) { return rootToken != null ? rootToken.findToken(tokenPath) : null; }
public Token findToken(String relativeTokenPath) { if (relativeTokenPath == null) return null; String path = relativeTokenPath.trim(); if (path.length() == 0 || ".".equals(path)) return this; if ("..".equals(path)) return parent; if (path.startsWith("/")) { return processInstance.getRootToken().findToken(path.substring(1)); } if (path.startsWith("./")) return findToken(path.substring(2)); if (path.startsWith("../")) { return parent != null ? parent.findToken(path.substring(3)) : null; } if (children == null) return null; int slashIndex = path.indexOf('/'); if (slashIndex == -1) return (Token) children.get(path); Token token = (Token) children.get(path.substring(0, slashIndex)); return token != null ? token.findToken(path.substring(slashIndex + 1)) : null; }
public Token findToken(String relativeTokenPath) { if (relativeTokenPath == null) return null; String path = relativeTokenPath.trim(); if (path.length() == 0 || ".".equals(path)) return this; if ("..".equals(path)) return parent; if (path.startsWith("/")) { return processInstance.getRootToken().findToken(path.substring(1)); } if (path.startsWith("./")) return findToken(path.substring(2)); if (path.startsWith("../")) { return parent != null ? parent.findToken(path.substring(3)) : null; } if (children == null) return null; int slashIndex = path.indexOf('/'); if (slashIndex == -1) return (Token) children.get(path); Token token = (Token) children.get(path.substring(0, slashIndex)); return token != null ? token.findToken(path.substring(slashIndex + 1)) : null; }
public void execute(ExecutionContext executionContext) { Token token = executionContext.getToken(); // get the token on which the milestone should be verified Token milestoneToken = token.findToken( tokenPath ); if ( isMilestoneReached( name, milestoneToken ) ) { // continue to pass the token over the default transition token.getNode().leave(executionContext); } else { addMilestoneListener(name,milestoneToken); } }
public void execute(ExecutionContext executionContext) { Token token = executionContext.getToken(); // get the token on which the milestone should be verified Token milestoneToken = token.findToken( tokenPath ); if ( isMilestoneReached( name, milestoneToken ) ) { // continue to pass the token over the default transition token.getNode().leave(executionContext); } else { addMilestoneListener(name,milestoneToken); } }