Fix problems in JoinPseudoState
- Fix possible NPE which is a regression. - Fix state entry notification for JOIN states. - Fixes #229
This commit is contained in:
@@ -105,7 +105,8 @@ public class JoinPseudoState<S, E> extends AbstractPseudoState<S, E> {
|
||||
|
||||
@Override
|
||||
public void onEntry(StateContext<S, E> context) {
|
||||
if (StateMachineUtils.isPseudoState(context.getTransition().getTarget(), PseudoStateKind.END)) {
|
||||
if (context.getTransition() != null && StateMachineUtils
|
||||
.isPseudoState(context.getTransition().getTarget(), PseudoStateKind.END)) {
|
||||
if (!notified && track.size() > 0) {
|
||||
track.remove(t);
|
||||
if (track.size() == 0) {
|
||||
|
||||
@@ -1142,7 +1142,11 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
}
|
||||
}
|
||||
|
||||
notifyStateEntered(buildStateContext(Stage.STATE_ENTRY, message, transition, getRelayStateMachine(), null, state));
|
||||
// with linked joins, we need to enter state but should not notify.
|
||||
// state entries are needed to track join logic.
|
||||
if (!StateMachineUtils.isPseudoState(state, PseudoStateKind.JOIN)) {
|
||||
notifyStateEntered(buildStateContext(Stage.STATE_ENTRY, message, transition, getRelayStateMachine(), null, state));
|
||||
}
|
||||
log.debug("Enter state=[" + state + "]");
|
||||
state.entry(stateContext);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user