/** * notifies a parent that one of its nodeMap has ended. */ private void notifyParentOfTokenEnd() { if (isRoot()) { processInstance.end(); } else if (parent != null && !parent.hasActiveChildren()) { parent.end(); } }
/** * notifies a parent that one of its nodeMap has ended. */ private void notifyParentOfTokenEnd() { if (isRoot()) { processInstance.end(); } else if (parent != null && !parent.hasActiveChildren()) { parent.end(); } }
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); }
reactivateParent = !parentToken.hasActiveChildren() && mustParentBeReactivated(parentToken, tokenNames); reactivateParent = !parentToken.hasActiveChildren() && mustParentBeReactivated(parentToken, tokenNames);
reactivateParent = !parentToken.hasActiveChildren() && mustParentBeReactivated(parentToken, tokenNames); reactivateParent = !parentToken.hasActiveChildren() && mustParentBeReactivated(parentToken, tokenNames);