spring-projects / spring-statemachine

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

A question about persistence use #1160

Open glmapper opened 3 months ago

glmapper commented 3 months ago

The code below is my state machine configuration class

@Autowired
private StateMachineRuntimePersister<States, Events, String> stateMachineRuntimePersister;

@Override
public void configure(StateMachineConfigurationConfigurer<States, Events> config) throws Exception {
    config.withPersistence().runtimePersister(stateMachineRuntimePersister);
    // set machineId or not?
    config.withConfiguration().machineId("orderStateMachine").autoStartup(true);
}

stateMachineRuntimePersister instance type is MongoDbPersistingStateMachineInterceptor。

The questions and doubts I have are:

image