-1
public void configure(StateMachineConfigurationConfigurer<States, Events> config) throws Exception {
config
.withConfiguration()
.machineId("test")
.autoStartup(false)
.listener(listener());
}
このコードセグメントは、ID「テスト」をセットアップするためにマシンを私にすることができますが、私はそれを開始する前に、私が独自にいくつかのパラメータに基づいて、いくつかのUUIDと私のそれぞれのマシンを識別することが可能な環境で仕事をしたい場合それが戻って来ているとき、それは同じ状態のマシンを起動するように、どのように私はそれを行うと、イベントに同じを共有することができ春ステートマシン
public void start(Request incomingRequest) {
WorkflowInstance instance = new WorkflowInstance();
instance.setSomeMessage(incomingRequest.getMessage());
instance = workflowInstanceRepository.save(instance); //This will generate an UUID which I want to use to get my machine everytime I am coming back and changing the transition
//ID should be taken from the config? or how as each one will have a separate data
StateMachine<States, Events> stateMachine = factory.getStateMachine();
stateMachine.start();
Message<Events> message = MessageBuilder
.withPayload(Events.INITIALIZING)
.setHeader("message", incomingRequest).build();
stateMachine.sendEvent(message);
}