Description
When creating a state machine the initial state is passed as a constructor parameter but "enter" event on that state is never triggered.
One way to get around this is to have a empty initial state which does nothing and trigger a transition to the first real initial state on which transitions other things could rely.
I'm not sure what would be better solution to this. Maybe there could be possibility to have a state machine in undefined state in the beginning with a start
method which would properly transition into the "initial" state. Or have a way to force state transition like stateMachine.transitionTo(state)
where it would just exit the previous one (if there's any) and enter the new one without any restrictions - this way the first transition would be done manually and since then it could be message driven.
Or maybe just trigger the enter transition in the constructor where currently there is only an assignment but that might lead to some synchronization issues.