Skip to content

How to start persisted state-machines on application startup? #923

@maseev

Description

@maseev

I've got a state-machine factory configuration with MongoDB persistence and states which use TimerTrigger (timer method) to periodically poll information from external services.

Is it possible to start all the persisted state-machine instances on the application startup and run them from the last state?
In other words, I expect that the state-machines are going to run the TimerTrigger states via the ThreadPoolScheduler automatically upon application startup.

Right now, it's not clear how to achieve this with StateMachineService or StateMachineRuntimePersister.
If I'm not mistaken, @EnableStateMachine annotation is only applicable to a single state-machine instance per application and doesn't stack with @EnableStateMachineFactory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions