if (state instanceof SteadyState) {
final SteadyState steadyState = (SteadyState) state;
AbstractFiniteState nextState = steadyState.doTransition(key, this);
if (nextState == null) {
// no transition found, check if there is a global transition
AbstractTransitionState transition = _transitions.get(key);
if (transition == null) {
transition = _transitions.get("*");
}
if (transition != null) {
nextState = transition.doTransition(state, this);
}
}
if (nextState != null) {
if (nextState != state) {
setCurrentState(nextState, false);
return true;
}
}
} else if (state == null) {
// check if there is a global transition
AbstractTransitionState transition = _transitions.get(key);
if (transition == null) {
transition = _transitions.get("*");
}
if (transition != null) {
setCurrentState(transition.doTransition(state, this), true);
return true;
}
}
// no transition found