/** indicates if a leaving transition with the given transitionName exists. */ public boolean hasOutgoingTransition(String transitionName) { return (getOutgoingTransition(transitionName)!=null); }
/** searches for the given transitionName in this node and then up the * parent chain. Returns null if no such transition is found. */ public TransitionImpl findOutgoingTransition(String transitionName) { TransitionImpl transition = getOutgoingTransition(transitionName); if (transition!=null) { return transition; } if (parentNode!=null) { return parentNode.findOutgoingTransition(transitionName); } return null; }
public TransitionImpl getOutgoingTransition(NodeImpl node, String transitionName) { // first check if the requested transition is in the added transition list if (addedTransitions!=null) { for (AddedTransition addedTransition : addedTransitions) { if ( node.equals(addedTransition.getSource()) && addedTransition.getName()!=null && addedTransition.getName().equals(transitionName) ) { return addedTransition; } } } // now, check if it is in the normal transition list in the process definition TransitionImpl transition = node.getOutgoingTransition(transitionName); if ( (transition!=null) // if the transition exists && (removedTransitions!=null) // and if there are removed transitions && (removedTransitions.contains(transition)) // and if the transition found in the process definition is present in the removedTransitions collection ) { // then pretent it wasn't there :-) return null; } return transition; }