Spring Statemachine is statefull? -
i'm leaning ssm, blow demo config:
@override public void configure(statemachineconfigurationconfigurer<states, events> config) throws exception { config.withconfiguration() .autostartup(true) .listener(listener()); } @override public void configure(statemachinestateconfigurer<states, events> states) throws exception { states.withstates() .initial(states.s_1) .state(states.s_1, myaction(), null) .end(states.s_end) .states(enumset.allof(states.class)); } @override public void configure(statemachinetransitionconfigurer<states, events> transitions) throws exception { transitions .withexternal() .source(states.s_1).target(states.s_2).event(events.e1).action(myaction()); }
i send 2 event machine, run onece.
statemachine.sendevent(events.e1); statemachine.sendevent(events.e1);
does ssm has state, how can make run stateless?
i want use define business procedure.
well looks event e1
takes machine s_1
s_2
. sending event again not machine in state s_2
, transition s_1
s_2
cannot happen.
not sure mean making machine stateless?
Comments
Post a Comment