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

Rescue from failed transition to another state #527

Open
ingemar opened this issue Dec 15, 2023 · 1 comment
Open

Rescue from failed transition to another state #527

ingemar opened this issue Dec 15, 2023 · 1 comment

Comments

@ingemar
Copy link

ingemar commented Dec 15, 2023

Hello,

First off, thank you for the excellent work on this state machine!

I have a feature suggestion. Would it be possible to incorporate a mechanism that allows rescuing failed transitions by enabling a transition to an alternate state?

Conceptually, I envision something along these lines:

class MyStatesMachine
  include Statesman::Machine

  state :draft, initial: true
  state :created
  state :published
  state :failed

  rescue_from_failed_transition_to :published, with: :failed

  # ...
end

If you think this feature is a good fit and it makes sense for future plans, I'd be stoked to help out by submitting a pull request. Please let me know if you would be open to reviewing and considering it.

Looking forward to your feedback.

@ingemar
Copy link
Author

ingemar commented Jan 15, 2024

Ping @lawrencejones, @thom-oman. 😊

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