Skip to content

State machine sub-regions do not resume from last state after restore from persistence #811

Open
@razmanolescu

Description

@razmanolescu

Problem statement

Issues

  • Using default configuration (with persistence provided by JpaRepositoryStateMachinePersist), all sub-regions seem to be reset upon restarting the SM. It continues from the fork parent task and re-runs all children.
  • It seems that if one of the sub-regions is in end-state and one is not (and persisted as such), the finalization (reaching end-state) of the latter will not trigger transition to join state and SM is stuck.

Expectations

  • The expectation is that all sub-regions current states are persisted by default. Once a SM is acquired from persistence source, it should initialize all sub-state current states correctly and begin transitioning
  • If one or more forked regions are saved with end-state, restarting parent SM should not inhibit transitioning to join-state, if remaining regions reach end-state.

Observations

It appears that the current state of each sub-region is persisted using the parent context (except in the case of initial state). This in turn overwrites the last sub-statemachine state, instead of being additive.
This works on explicit persistence of entire SM, so it may be that there might be an issue with context building.

Please see repo with example here

Please let me know if any additional details or setup support is required.

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