Skip to content

How to transition directly to a specific state instead of triggering a transition name? #603

@vanasis

Description

@vanasis

Hello,

I'm using Stateless to manage a state machine with predefined states and transitions, and I would like to make my state machine work by targeting specific states rather than by triggering transitions by name. My goal is to simplify the usage so that, if I specify a target state (e.g., GoToState("Approved")), the state machine would check if a valid transition exists to that state from the current state. If the transition is valid, it would perform it; if not, it would block it.

To clarify, I want to:

Specify the target state directly instead of calling Fire() with a trigger name.
Check for a valid transition path from the current state to the target state before making the transition.
Is there a way to implement or extend Stateless to support this kind of "state-based" transition approach, rather than using trigger names?

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