* This leave the current state over the given transition name.
*/
public void signal(String transitionName)
{
if (node == null)
throw new JbpmException("token '" + this + "' can't be signalled cause it is currently not positioned in a node");
Transition leavingTransition = node.getLeavingTransition(transitionName);
if (leavingTransition == null)
{
// Fall back to the name of the target node
for (Transition auxTrans : node.getLeavingTransitions())
{
if (transitionName.equals(auxTrans.getTo().getName()))
{
leavingTransition = auxTrans;
break;
}
}
}
if (leavingTransition == null)
throw new JbpmException("transition '" + transitionName + "' does not exist on " + node);
signal(leavingTransition, new ExecutionContext(this));
}