protected VariableContainer getParentVariableContainer() { Token parentToken = token.getParent(); return parentToken != null ? contextInstance.getTokenVariableMap(parentToken) : null; }
protected VariableContainer getParentVariableContainer() { Token parentToken = token.getParent(); return parentToken != null ? contextInstance.getTokenVariableMap(parentToken) : null; }
/** * looks for the first token-variable-map that is found up the token-parent hierarchy. */ public TokenVariableMap getTokenVariableMap(Token token) { TokenVariableMap tokenVariableMap = null; if (tokenVariableMaps != null) { if (tokenVariableMaps.containsKey(token)) { tokenVariableMap = (TokenVariableMap) tokenVariableMaps.get(token); } else if (!token.isRoot()) { tokenVariableMap = getTokenVariableMap(token.getParent()); } } return tokenVariableMap; }
public String getFullName() { if (isRoot()) return "/"; StringBuffer nameBuilder = new StringBuffer(); for (Token token = this; token.hasParent(); token = token.getParent()) { String tokenName = token.getName(); if (tokenName != null) nameBuilder.insert(0, tokenName); nameBuilder.insert(0, '/'); } return nameBuilder.toString(); }
public String getFullName() { if (isRoot()) return "/"; StringBuffer nameBuilder = new StringBuffer(); for (Token token = this; token.hasParent(); token = token.getParent()) { String tokenName = token.getName(); if (tokenName != null) nameBuilder.insert(0, tokenName); nameBuilder.insert(0, '/'); } return nameBuilder.toString(); }
/** * looks for the first token-variable-map that is found up the token-parent hierarchy. */ public TokenVariableMap getTokenVariableMap(Token token) { TokenVariableMap tokenVariableMap = null; if (tokenVariableMaps != null) { if (tokenVariableMaps.containsKey(token)) { tokenVariableMap = (TokenVariableMap) tokenVariableMaps.get(token); } else if (!token.isRoot()) { tokenVariableMap = getTokenVariableMap(token.getParent()); } } return tokenVariableMap; }
private boolean evaluateScript(ExecutionContext executionContext) { Map outputMap = script.eval(executionContext); if (outputMap.size() == 1) { // extract single output value Object result = outputMap.values().iterator().next(); // if result is a collection if (result instanceof Collection) { Token parentToken = executionContext.getToken().getParent(); return !parentToken.hasActiveChildren() && mustParentBeReactivated(parentToken, (Collection) result); } // if it is a boolean... else if (result instanceof Boolean) { // the boolean value tells whether the parent must be reactivated return ((Boolean) result).booleanValue(); } // any other object else { // non-null result means the parent must be reactivated return result != null; } } throw new JbpmException("expected " + script + " to write one variable, output was: " + outputMap); }
private boolean evaluateScript(ExecutionContext executionContext) { Map outputMap = script.eval(executionContext); if (outputMap.size() == 1) { // extract single output value Object result = outputMap.values().iterator().next(); // if result is a collection if (result instanceof Collection) { Token parentToken = executionContext.getToken().getParent(); return !parentToken.hasActiveChildren() && mustParentBeReactivated(parentToken, (Collection) result); } // if it is a boolean... else if (result instanceof Boolean) { // the boolean value tells whether the parent must be reactivated return ((Boolean) result).booleanValue(); } // any other object else { // non-null result means the parent must be reactivated return result != null; } } throw new JbpmException("expected " + script + " to write one variable, output was: " + outputMap); }
/** * searches for the first token-variable-map for the given token and creates it on the root * token if it doesn't exist. */ public TokenVariableMap getOrCreateTokenVariableMap(Token token) { if (token == null) { throw new JbpmException("can't get variables for token 'null'"); } // if the given token has a variable map TokenVariableMap tokenVariableMap = null; if ((tokenVariableMaps != null) && (tokenVariableMaps.containsKey(token))) { tokenVariableMap = (TokenVariableMap) tokenVariableMaps.get(token); } else if (!token.isRoot()) { tokenVariableMap = getOrCreateTokenVariableMap(token.getParent()); } else { tokenVariableMap = createTokenVariableMap(token); } return tokenVariableMap; }
/** * searches for the first token-variable-map for the given token and creates it on the root * token if it doesn't exist. */ public TokenVariableMap getOrCreateTokenVariableMap(Token token) { if (token == null) { throw new JbpmException("can't get variables for token 'null'"); } // if the given token has a variable map TokenVariableMap tokenVariableMap = null; if ((tokenVariableMaps != null) && (tokenVariableMaps.containsKey(token))) { tokenVariableMap = (TokenVariableMap) tokenVariableMaps.get(token); } else if (!token.isRoot()) { tokenVariableMap = getOrCreateTokenVariableMap(token.getParent()); } else { tokenVariableMap = createTokenVariableMap(token); } return tokenVariableMap; }
Collection concurrentTokens = token.getParent().getChildren().values(); boolean reactivate = true; Iterator iter = concurrentTokens.iterator();
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Token)) return false; Token other = (Token) o; if (id != 0 && id == other.getId()) return true; return (name != null ? name.equals(other.getName()) : other.getName() == null) && (parent != null ? parent.equals(other.getParent()) : processInstance.equals(other.getProcessInstance())); }
Collection concurrentTokens = token.getParent().getChildren().values(); boolean reactivate = true; Iterator iter = concurrentTokens.iterator();
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Token)) return false; Token other = (Token) o; if (id != 0 && id == other.getId()) return true; return (name != null ? name.equals(other.getName()) : other.getName() == null) && (parent != null ? parent.equals(other.getParent()) : processInstance.equals(other.getProcessInstance())); }
Token parentToken = arrivingToken.getParent(); boolean reactivateParent;
Token parentToken = arrivingToken.getParent(); boolean reactivateParent;