in src/main/java/org/apache/commons/scxml2/semantics/SCXMLSemanticsImpl.java [301:333]
public void macroStep(final SCXMLExecutionContext exctx, final Set<TransitionalState> statesToInvoke)
throws ModelException {
do {
boolean macroStepDone = false;
do {
Step step = new Step(null);
selectTransitions(exctx, step);
if (step.getTransitList().isEmpty()) {
final TriggerEvent event = exctx.nextInternalEvent();
if (event != null) {
if (isCancelEvent(event)) {
exctx.stop();
}
else {
setSystemEventVariable(exctx.getScInstance(), event, true);
step = new Step(event);
selectTransitions(exctx, step);
}
} else {
macroStepDone = true;
}
}
if (!step.getTransitList().isEmpty()) {
microStep(exctx, step, statesToInvoke);
}
} while (exctx.isRunning() && !macroStepDone);
if (exctx.isRunning() && !statesToInvoke.isEmpty()) {
initiateInvokes(exctx, statesToInvoke);
statesToInvoke.clear();
}
} while (exctx.isRunning() && exctx.hasPendingInternalEvent());
}