*/
static void updateSCXML(final SCXML scxml) throws ModelException {
initDocumentOrder(scxml.getChildren(), 1);
String initial = scxml.getInitial();
SimpleTransition initialTransition = new SimpleTransition();
if (initial != null) {
initialTransition.setNext(scxml.getInitial());
updateTransition(initialTransition, scxml.getTargets());
if (initialTransition.getTargets().size() == 0) {
logAndThrowModelError(ERR_SCXML_NO_INIT, new Object[] {
initial });
}
} else {
// If 'initial' is not specified, the default initial state is
// the first child state in document order.
initialTransition.getTargets().add(scxml.getFirstChild());
}
scxml.setInitialTransition(initialTransition);
Map<String, TransitionTarget> targets = scxml.getTargets();
for (EnterableState es : scxml.getChildren()) {