Open aniketvsawant opened 6 years ago
please refer to the "Save/Load State Machine Data" in the doc. By default squirrel provide string content based StateMachineData implementation, for simple solution you can just dump the state machine data and store where u want, and restore the state machine states by reload from the string data. Or you can customize the StateMachineData(Reader/Writer) implementation for more fine granularity storage control. The customized StateMachineData can be register into state machine by org.squirrelframework.foundation.component.SquirrelProvider#register, register the StateMachineData interface with ur customize implementations.
Thanks @hekailiang I have gone through the documentation and find helpful. As per my understanding we can create a single instance of state machine at a time. If its correct then I would like to know the -
As state machine is associated with the entity object (e.g. User), how can squirrel maintain multiple instances of state machine per entity as an embedded state machine behaviour without persistence. Is this the out of the box feature or do we need to implement our own solution.
Hi Team, I am in a process of evaluating squirrel state machine and looking for the features that are best fits to my requirement. As a state machine I would like to persist the states as I have long running states requirement. As this state machine is embedded in nature and tightly coupled with the application, any failure in the application will results into the loss of the state machines instances and will be hard to recover the states back when application restarts. What is the best way to store and recover the states of an entities. Do you have any plan to support out of the box persistence capability. Thanks.