Skip to content

Rescue from failed transition to another state #527

@ingemar

Description

@ingemar

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions