/** Default BPMN logic when an activity ends */ @Override public void onwards() { if (log.isDebugEnabled()) { log.debug("Onwards " + this); } // First we end the activity instance. // Subsequent invocations to end will be ignored. end(); boolean isTransitionTaken = false; // Take each outgoing transition 'in parallel' // Note that process concurrency is not the same as java multithreaded computation if (activity.hasOutgoingTransitions()) { for (TransitionImpl transition : activity.outgoingTransitions) { // Only take a transition if there is no condition or if the condition resolves to true. ConditionImpl condition = transition.condition; if (condition != null ? condition.eval(this) : true) { isTransitionTaken = true; takeTransition(transition); } } } // if there were no outgoing transitions or none of them could be taken, if (!isTransitionTaken) { // propagate the execution flow upwards to the parent propagateToParent(); } }