spring-projects / spring-statemachine

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

when i persist the statemachine which do not config event, laterly restore it and run , the statemachine will be running and can't stop!!! #1051

Open Luckylau opened 2 years ago

Luckylau commented 2 years ago

my config like this : ` @Override 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") .state("S2_3") .state("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")
            .and().withChoice().source("S2_2").first("S2_3", context -> true).last("S2_4")
            .and().withExternal().source("S2_3").target("S3");
}`

i use some way perist the statemachine at S2_1 state, laterly i restore from redis and run it , i find the machine will be always running and can't stop ; why does it happen ?

AbstractAlao commented 2 years ago

Where is the code that you use to restore?