JpaRepositoryStateMachinePersist is not using the contextObj when building machine state
When using the DefaultStateMachinePersister with JpaRepositoryStateMachinePersist to persist a statemachine then the machineId is taken from the StateMachineContext object and the contextObj is unused - link to code
When restoring the statemachine, then the state is read from the DB using getRepository().findById(contextObj.toString()) - link to code
As a result the statemachine cannot be restored using the contextObj because when it was first persisted the machineId was used as the primary key and nothing is found from the DB when restoring and trying to use the findById(contextObj.toString())
Using Spring Statemachine version 2.1.1
Any comment @jvalkeal ?
I was looking at the JpaRepositoryStateMachinePersist and noticed that the setMachineId is using the StateMachineContext to get the stored ID and persist this; however, in the MongoDbRepositoryStateMachine AND RedisRepositoryStateMachineId it is using contextObject itself. Is that on purpose? @jvalkeal
@jvalkeal I can do a pull request and make this change, but want to confirm if the JPA is different by design. Can't find any documentation on the matter.
I have the same question,any update?
Same error 3.2.0, any update to fix the error ? Can do the PR