Compare commits

...

5 Commits

2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@
<groupId>me.bvn13.fsm</groupId>
<artifactId>fsm</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
<packaging>jar</packaging>

View File

@ -149,9 +149,9 @@ public class Fsm<T extends Fsm, E> {
return;
}
currentState.process(event);
currentState.afterEvent();
if (currentState.isFinish()) {
done = true;
currentState.afterEvent();
return;
}
switchToNextState(event);
@ -278,6 +278,7 @@ public class Fsm<T extends Fsm, E> {
}
private void nextState(State<E> state, E event) {
currentState.afterEvent();
previousState = currentState;
currentState = state;
currentState.beforeEvent();