-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
not goodIt's not a real bug but simply not goodIt's not a real bug but simply not good
Description
Currently, every state can be passed into the StateMachineBuilder's function withInitialState(State s). This is a problem because right now the actions of these states are not executed. There are two possible ways to fix this:
- Make sure every action gets executed on state instantiation (i.e. from the constructor). This would reduce complexity and reflect the common view of action execution in state machines. On the other hand, it leads to problems becauce the current state of the state machine is not updated until the constructor finished creating the new state. When action execution takes a while or leads to an error, there is a problem with the state machine's current state.
What's worse: The state machine reference would have to be passed in to the constructor making instantiation more problematic. - Allow only waiting states to be passed into
withInitialState(State s). This seems to make more sense because the state machine can then not simply start executing but would have to wait for any transition to be fired. Requires editing the inheritance hierarchy.
Metadata
Metadata
Assignees
Labels
not goodIt's not a real bug but simply not goodIt's not a real bug but simply not good