spring-projects / spring-statemachine

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

DefaultStateMachineService.hasStateMachine doesn't consider persisted state machines #884

Open jbasb opened 3 years ago

jvalkeal commented 3 years ago

Not sure what you mean, could you provide more context?

jbasb commented 3 years ago

The function hasStateMachine(String machineId) only checks the local HashMap for the existence of the ID. Shouldn't it also check for the existence of the state machine in the repository by using the stateMachinePersist object? The function acquireStateMachine does check the stateMachinePersist for the ID, and restores that state machine if it exists. This means hasStateMachine will return false even if the state machine exists in the repository but not locally.