spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.53k stars 599 forks source link

when i perisit and restore from redis, why it can't go to the end state? #1050

Open Luckylau opened 2 years ago

Luckylau commented 2 years ago

here is my config:

`public void configure(StateMachineStateConfigurer<String, String> states) throws Exception { states.withStates() .initial("S1") .state("S2") .end("S3") .and() .withStates() .parent("S2") .initial("S2_1") .choice("S2_2") .end("S2_3") .end("S2_4") ; }

@Override
public void configure(StateMachineTransitionConfigurer<String, String> transitions) throws Exception {
    transitions.withExternal()
            .source("S1").target("S2")
            .and().withExternal().source("S2_1").target("S2_2").event("notice")
            .and().withChoice().source("S2_2").first("S2_3", context -> true).last("S2_4")
            .and().withExternal().source("S2_3").target("S3");
}`

when i perist it at S2_2 state , lately read from redis and send event "notice" ,the statemachine go to S2_3 state and then stop; why not go to S3; when i change the config to
.parent("S2") .initial("S2_1") .choice("S2_2") **.state("S2_3")** **.state("S2_4")** it can go to S3;
please help me, thanks;