Open mroeppis opened 1 year ago
Consider this simple Statemachine with 3 states and 1 event:
START -(NEXT)-> IN_BETWEEN -> END
The use case here is:
NEXT
The machine runs with a StateMachineListener.
StateMachineListener
The issue mainly concerns Spring Statemachine Core 3.2.0 but points out something that might be wrong as well with version 2.5.1.
3.2.0
2.5.1
The method StateMachineListener#stateChanged( from, to) is called differently in version 2.5.1 and 3.2.0.
StateMachineListener#stateChanged( from, to)
I attached a MWE with a test for reference (built with Gradle 7.5.1 and JDK 17.0.6).
7.5.1
17.0.6
The listener is notified of each state change, i.e. 3 times. But the order of notification is not the order of change:
null
START
IN_BETWEEN
END
Keeping order is important if the listener must prepare something for an upcoming state change.
The listener misses one notification, i.e. the first state change after the event is sent:
The listener should be notified of all state changes in order:
Issue Setting
Consider this simple Statemachine with 3 states and 1 event:
The use case here is:
NEXT
The machine runs with a
StateMachineListener
.Version Specifics
The issue mainly concerns Spring Statemachine Core
3.2.0
but points out something that might be wrong as well with version2.5.1
.Issue Description
The method
StateMachineListener#stateChanged( from, to)
is called differently in version2.5.1
and3.2.0
.I attached a MWE with a test for reference (built with Gradle
7.5.1
and JDK17.0.6
).Version
2.5.1
The listener is notified of each state change, i.e. 3 times. But the order of notification is not the order of change:
null
->START
IN_BETWEEN
->END
START
->IN_BETWEEN
Keeping order is important if the listener must prepare something for an upcoming state change.
Version
3.2.0
The listener misses one notification, i.e. the first state change after the event is sent:
null
->START
IN_BETWEEN
->END
Expected Behavior
The listener should be notified of all state changes in order:
null
->START
START
->IN_BETWEEN
IN_BETWEEN
->END