public void configure(StateMachineConfigurationConfigurer<States, Events> config) throws Exception {
config
.withConfiguration()
.machineId("test")
.autoStartup(false)
.listener(listener());
}
This code segment allows me to setup a machine with ID "test" but if I want to work in an environment where I can uniquely identify my each machine with some UUID based on some parameter before starting it how I can do that and share same to the event so that when it is coming back it will start the same state machine
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);
}