-1
public void configure(StateMachineConfigurationConfigurer<States, Events> config) throws Exception {
config
.withConfiguration()
.machineId("test")
.autoStartup(false)
.listener(listener());
}
이 코드 세그먼트를 사용하면 ID "test"가있는 컴퓨터를 설정할 수 있지만 시작하기 전에 일부 매개 변수에 따라 일부 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);
}
을 시작할 수 있도록 내가 그렇게하고 이벤트에 같은 공유 할 수있는 방법