squirrel-foundation is a State Machine library, which provided a lightweight, easy use, type safe and programmable state machine implementation for Java.
Internal
21:40:36.839 [main] INFO o.s.f.fsm.StateMachineLogger - MyStateMachine(2fEFYCwbIl): Transition from "S" on "INTERNAL_TRANSITION" with context "null" begin.
21:40:36.844 [main] INFO o.s.f.fsm.StateMachineLogger - MyStateMachine(2fEFYCwbIl): Transition from "S" to "S" on "INTERNAL_TRANSITION" complete which took 4.437 ms.
Self
21:40:36.844 [main] INFO o.s.f.fsm.StateMachineLogger - MyStateMachine(2fEFYCwbIl): Transition from "S" on "SELF_TRANSITION" with context "null" begin.
21:40:36.845 [main] INFO o.s.f.fsm.StateMachineLogger - Before execute method call action "exitS:-10" (1 of 4).
21:40:36.845 [main] INFO o.s.f.fsm.StateMachineLogger - After execute method call action "exitS:-10" which took 209.2 μs.
21:40:36.846 [main] INFO o.s.f.fsm.StateMachineLogger - Before execute method call action "entryS:-10" (2 of 4).
21:40:36.846 [main] INFO o.s.f.fsm.StateMachineLogger - After execute method call action "entryS:-10" which took 168.6 μs.
21:40:36.846 [main] INFO o.s.f.fsm.StateMachineLogger - Before execute method call action "exitS:-10" (3 of 4).
21:40:36.846 [main] INFO o.s.f.fsm.StateMachineLogger - After execute method call action "exitS:-10" which took 103.8 μs.
21:40:36.846 [main] INFO o.s.f.fsm.StateMachineLogger - Before execute method call action "entryS:-10" (4 of 4).
21:40:36.846 [main] INFO o.s.f.fsm.StateMachineLogger - After execute method call action "entryS:-10" which took 101.6 μs.
21:40:36.847 [main] INFO o.s.f.fsm.StateMachineLogger - MyStateMachine(2fEFYCwbIl): Transition from "S" to "S" on "SELF_TRANSITION" complete which took 2.093 ms.
I would expect an external transition from
S -> S
to produce the following actions:exitS
entryS
i.e.
S -> (exitS) -> (entryS) -> S
Instead, I see twice as many
exitS
entryS
exitS
entryS
i.e.
S -> (exitS) -> (entryS) -> (exitS) -> (entryS) -> S
Is this the expected behavior?
Example code:
Output: