Fix StateMachineInterceptor calls
- Due to a regression when new preStateChange method were added to pass on root machine, old method did not get called anymore. Now calling that as well and fixing some other things around it. - Same changes for postStateChange. - Fixes #633
This commit is contained in:
@@ -115,12 +115,6 @@ public class PersistStateMachineHandler extends LifecycleObjectSupport {
|
||||
|
||||
private class PersistingStateChangeInterceptor extends StateMachineInterceptorAdapter<String, String> {
|
||||
|
||||
@Override
|
||||
public void preStateChange(State<String, String> state, Message<String> message,
|
||||
Transition<String, String> transition, StateMachine<String, String> stateMachine) {
|
||||
listeners.onPersist(state, message, transition, stateMachine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preStateChange(State<String, String> state, Message<String> message,
|
||||
Transition<String, String> transition, StateMachine<String, String> stateMachine,
|
||||
|
||||
@@ -850,7 +850,8 @@ public class TasksHandler {
|
||||
|
||||
@Override
|
||||
public void preStateChange(State<String, String> state, Message<String> message,
|
||||
Transition<String, String> transition, StateMachine<String, String> stateMachine) {
|
||||
Transition<String, String> transition, StateMachine<String, String> stateMachine,
|
||||
StateMachine<String, String> rootStateMachine) {
|
||||
|
||||
// skip all other pseudostates than initial
|
||||
if (state == null || (state.getPseudoState() != null && state.getPseudoState().getKind() != PseudoStateKind.INITIAL)) {
|
||||
@@ -878,13 +879,6 @@ public class TasksHandler {
|
||||
throw new StateMachineException("Error persisting", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preStateChange(State<String, String> state, Message<String> message,
|
||||
Transition<String, String> transition, StateMachine<String, String> stateMachine,
|
||||
StateMachine<String, String> rootStateMachine) {
|
||||
preStateChange(state, message, transition, stateMachine);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user