/** * checks for the presence of a leaving transition with the given name. the leaving * transitions of the supernode are taken into account as well. * * @return true if this node has a leaving transition with the given name, false otherwise. */ public boolean hasLeavingTransition(String transitionName) { return getLeavingTransition(transitionName) != null; }
/** * sends a signal to this token. leaves the current {@link #getNode() node} over the * transition with the given name. */ public void signal(String transitionName) { if (node == null) { throw new JbpmException(this + " is not positioned in a node"); } Transition leavingTransition = node.getLeavingTransition(transitionName); if (leavingTransition == null) { // fall back to target node name for (Iterator iter = node.getLeavingTransitions().iterator(); iter.hasNext();) { Transition transition = (Transition) iter.next(); if (transitionName.equals(transition.getTo().getName())) { leavingTransition = transition; break; } } if (leavingTransition == null) { throw new JbpmException(node + " has no leaving transition named " + transitionName); } } signal(leavingTransition, new ExecutionContext(this)); }
/** * checks for the presence of a leaving transition with the given name. the leaving * transitions of the supernode are taken into account as well. * * @return true if this node has a leaving transition with the given name, false otherwise. */ public boolean hasLeavingTransition(String transitionName) { return getLeavingTransition(transitionName) != null; }
/** * sends a signal to this token. leaves the current {@link #getNode() node} over the * transition with the given name. */ public void signal(String transitionName) { if (node == null) { throw new JbpmException(this + " is not positioned in a node"); } Transition leavingTransition = node.getLeavingTransition(transitionName); if (leavingTransition == null) { // fall back to target node name for (Iterator iter = node.getLeavingTransitions().iterator(); iter.hasNext();) { Transition transition = (Transition) iter.next(); if (transitionName.equals(transition.getTo().getName())) { leavingTransition = transition; break; } } if (leavingTransition == null) { throw new JbpmException(node + " has no leaving transition named " + transitionName); } } signal(leavingTransition, new ExecutionContext(this)); }
/** * Does the current node have a default transition? */ public boolean hasDefaultTransition() { //we don't use jBPM's default transition, //instead we use the "anonymous" transition return getNode().getLeavingTransition(null)!=null; }
/** * called by the implementation of this node to continue execution over the specified * transition. */ public void leave(ExecutionContext executionContext, String transitionName) { Transition transition = getLeavingTransition(transitionName); if (transition == null) throw new JbpmException("no such transition: " + transitionName); leave(executionContext, transition); }
/** * called by the implementation of this node to continue execution over the specified * transition. */ public void leave(ExecutionContext executionContext, String transitionName) { Transition transition = getLeavingTransition(transitionName); if (transition == null) throw new JbpmException("no such transition: " + transitionName); leave(executionContext, transition); }
public boolean hasTransition(String outcome) { return isNullOutcome(outcome) ? hasDefaultTransition() : getNode().getLeavingTransition(outcome)!=null; }
/** * marks this task as done and specifies the name of a transition leaving the task-node for * the case that the completion of this task instances triggers a signal on the token. If this * task leads to a signal on the token, the given transition name will be used in the signal. * If this task completion does not trigger execution to move on, the transitionName is * ignored. */ public void end(String transitionName) { if (task == null) { throw new JbpmException(this + " has no task definition"); } Node node = task.getTaskNode(); if (node == null) { GraphElement parent = task.getParent(); if (!(parent instanceof Node)) { throw new JbpmException(this + " has no enclosing node"); } node = (Node) parent; } Transition leavingTransition = node.getLeavingTransition(transitionName); if (leavingTransition == null) { throw new JbpmException(node + " has no leaving transition named " + transitionName); } end(leavingTransition); }
/** * marks this task as done and specifies the name of a transition leaving the task-node for * the case that the completion of this task instances triggers a signal on the token. If this * task leads to a signal on the token, the given transition name will be used in the signal. * If this task completion does not trigger execution to move on, the transitionName is * ignored. */ public void end(String transitionName) { if (task == null) { throw new JbpmException(this + " has no task definition"); } Node node = task.getTaskNode(); if (node == null) { GraphElement parent = task.getParent(); if (!(parent instanceof Node)) { throw new JbpmException(this + " has no enclosing node"); } node = (Node) parent; } Transition leavingTransition = node.getLeavingTransition(transitionName); if (leavingTransition == null) { throw new JbpmException(node + " has no leaving transition named " + transitionName); } end(leavingTransition); }
if (transitionName != null && exception == null) { Node node = token.getNode(); Transition transition = node.getLeavingTransition(transitionName); if (transition != null) { token.signal(transition);
if (transitionName != null && exception == null) { Node node = token.getNode(); Transition transition = node.getLeavingTransition(transitionName); if (transition != null) { token.signal(transition);