Does Ruby on Rails have custom state workflow stones?

I am developing a Ruby on Rails application and am now looking for a workflow gem that allows you to configure states without any programming.

I found some gems: rails_workflow , state_machine , workflow .

But, as I understand it, these gems suggest that the states will be hard-coded, such as workflow gem states:

class Article
  include Workflow
  workflow do
    state :new do
      event :submit, :transitions_to => :awaiting_review
    end
    state :awaiting_review do
      event :review, :transitions_to => :being_reviewed
    end
    state :being_reviewed do
      event :accept, :transitions_to => :accepted
      event :reject, :transitions_to => :rejected
    end
    state :accepted
    state :rejected
  end
end

I need my application application users to be able to configure transition states and conditions on their own, without a developer.

Redmine already has this feature, but it’s ready to go, not a gem, which I can connect to my application

- ?

+4
3

. gem state_machine, ActiveRecord :

, 'to', 'from' 'on'. string .

:

Transition.create(:from => "parked", :to => "idling", :on => "ignite")

:

def transitions
  transitions_data = []
  Transition.all.each do |transition|
    transitions_data << { transition.from.to_sym => transition.to.to_sym, :on => transition.on.to_sym }  
  end
  transitions_data
end

, , " " .

, : " . . , ".

, .

:

fooobar.com/questions/1629099/... state_machine Gem

+5

rails_workflow gem :)

, . - ( - , , ..), , , .

, - rails_workflow - :) , .

0

redmine :

Waterfall

This is a brand new stone; I met its author at RubyLille this week. it is a way to elegantly link callbacks and get rails driven errors, you can create a reliable state machine with this.

-1
source

Source: https://habr.com/ru/post/1629097/


All Articles