Hello!
I'd like to ask/ascertain how "wildcard transitions" are supposed to work.
Suppose we have states, events and state machine description defined like this:
enum State {
A, B, C
}
enum Event {
ToB, ToC
}
@States({
@State(name="A", entryCallMethod="entryStateA", exitCallMethod="exitStateA"),
@State(name="B", entryCallMethod="entryStateB", exitCallMethod="exitStateB"),
@State(name="C", entryCallMethod="entryStateC", exitCallMethod="exitStateC"),
})
@Transitions({
@Transit(from="A", to="B", on="ToB", callMethod="fromStateAToStateBOnGotoB"),
@Transit(from="*", to="C", on="ToC", callMethod="fromAnyStateToStateCOnGotoC"),
})
interface DeclarativeStateMachine extends StateMachine<DeclarativeStateMachine, State, Event, Integer> {
... method declarations...
}
Does this FSM declaration mean that
1. when the SM is in A state, and ToB event received, then the SM is switched to B state and all appropriate methods are called?
2. And if the SM is in _any_ state and ToC event arrives then the SM is switched to C state and all suitable methods are called?
If the answer is "yes, the SM is supposed to work exactly like described above", then it seems that I've discovered a bug.
In this case the bug is in StateMachineBuilderImpl.installDeferBoundAction(DeferBoundActionInfo<T, S, E, C> deferBoundActionInfo)
The current (master) implementation of the method doesn't add all possible transitions (in our example: from A, B and C to C), but rather
adds the action from the wildcard transitions to pre-exisiting "completely defined" transitions which match the wildcard.
Thus with the current implementation these wildcard transitions are only usable to enrich existing SM behavior.
Or maybe this is expected and intended? Please explain.
Best regards,
Alexey