Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vanasis opened this issue Oct 31, 2024 · 0 comments

Comments

@vanasis
Copy link

vanasis commented Oct 31, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant