/** * is the default leaving transition. */ public Transition getDefaultLeavingTransition() { if (leavingTransitions != null && !leavingTransitions.isEmpty()) { // select the first unconditional transition for (Iterator i = leavingTransitions.iterator(); i.hasNext();) { Transition transition = (Transition) i.next(); if (transition.getCondition() == null) return transition; } // there is no unconditional transition, just pick the first one return (Transition) leavingTransitions.get(0); } else if (superState != null) { return superState.getDefaultLeavingTransition(); } return null; }
/** * is the default leaving transition. */ public Transition getDefaultLeavingTransition() { if (leavingTransitions != null && !leavingTransitions.isEmpty()) { // select the first unconditional transition for (Iterator i = leavingTransitions.iterator(); i.hasNext();) { Transition transition = (Transition) i.next(); if (transition.getCondition() == null) return transition; } // there is no unconditional transition, just pick the first one return (Transition) leavingTransitions.get(0); } else if (superState != null) { return superState.getDefaultLeavingTransition(); } return null; }
/** * adds available transitions of that node to the Set and after that calls itself recursively * for the SuperSate of the Node if it has a super state */ private void addAvailableTransitionsOfNode(Node currentNode, Set availableTransitions) { List leavingTransitions = currentNode.getLeavingTransitions(); if (leavingTransitions != null) { for (Iterator iter = leavingTransitions.iterator(); iter.hasNext();) { Transition transition = (Transition) iter.next(); String conditionExpression = transition.getCondition(); if (conditionExpression != null) { Boolean result = (Boolean) JbpmExpressionEvaluator.evaluate(conditionExpression, new ExecutionContext(this), Boolean.class); if (Boolean.TRUE.equals(result)) { availableTransitions.add(transition); } } else { availableTransitions.add(transition); } } } if (currentNode.getSuperState() != null) { addAvailableTransitionsOfNode(currentNode.getSuperState(), availableTransitions); } }
/** * adds available transitions of that node to the Set and after that calls itself recursively * for the SuperSate of the Node if it has a super state */ private void addAvailableTransitionsOfNode(Node currentNode, Set availableTransitions) { List leavingTransitions = currentNode.getLeavingTransitions(); if (leavingTransitions != null) { for (Iterator iter = leavingTransitions.iterator(); iter.hasNext();) { Transition transition = (Transition) iter.next(); String conditionExpression = transition.getCondition(); if (conditionExpression != null) { Boolean result = (Boolean) JbpmExpressionEvaluator.evaluate(conditionExpression, new ExecutionContext(this), Boolean.class); if (Boolean.TRUE.equals(result)) { availableTransitions.add(transition); } } else { availableTransitions.add(transition); } } } if (currentNode.getSuperState() != null) { addAvailableTransitionsOfNode(currentNode.getSuperState(), availableTransitions); } }
Transition candidate = (Transition) iter.next(); String condition = candidate.getCondition(); if (condition != null) { Boolean result = (Boolean) JbpmExpressionEvaluator
Transition candidate = (Transition) iter.next(); String condition = candidate.getCondition(); if (condition != null) { Boolean result = (Boolean) JbpmExpressionEvaluator