//ensure both onEntry and onExit have parent
//could add next two lines as a Digester rule for OnEntry/OnExit
s.getOnEntry().setParent(s);
s.getOnExit().setParent(s);
//initialize next / inital
Initial ini = s.getInitial();
Map c = s.getChildren();
TransitionTarget initialState = null;
if (!c.isEmpty()) {
if (ini == null) {
logAndThrowModelError(ERR_STATE_NO_INIT,
new Object[] {getStateName(s)});
}
Transition initialTransition = ini.getTransition();
updateTransition(initialTransition, targets);
initialState = initialTransition.getTarget();
// we have to allow for an indirect descendant initial (targets)
//check that initialState is a descendant of s
if (initialState == null