Class: Omnibot::WorkflowRun
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Omnibot::WorkflowRun
- Defined in:
- lib/omnibot/workflow_run.rb
Constant Summary collapse
- ACTIVE_STATUSES =
%w[running waiting_for_input waiting_for_human].freeze
- TERMINAL_STATUSES =
%w[done failed expired cancelled].freeze
Instance Attribute Summary collapse
-
#replies ⇒ Object
Returns the value of attribute replies.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #cancel! ⇒ Object
- #resume_from_human(input: nil) ⇒ Object
- #retry! ⇒ Object
- #terminal? ⇒ Boolean
- #workflow_class ⇒ Object
Instance Attribute Details
#replies ⇒ Object
Returns the value of attribute replies.
13 14 15 |
# File 'lib/omnibot/workflow_run.rb', line 13 def replies @replies end |
Instance Method Details
#active? ⇒ Boolean
17 |
# File 'lib/omnibot/workflow_run.rb', line 17 def active? = ACTIVE_STATUSES.include?(status) |
#cancel! ⇒ Object
22 |
# File 'lib/omnibot/workflow_run.rb', line 22 def cancel! = workflow_class.cancel!(self) |
#resume_from_human(input: nil) ⇒ Object
23 |
# File 'lib/omnibot/workflow_run.rb', line 23 def resume_from_human(input: nil) = workflow_class.resume_from_human(self, input: input) |
#retry! ⇒ Object
21 |
# File 'lib/omnibot/workflow_run.rb', line 21 def retry! = workflow_class.retry!(self) |
#terminal? ⇒ Boolean
18 |
# File 'lib/omnibot/workflow_run.rb', line 18 def terminal? = TERMINAL_STATUSES.include?(status) |
#workflow_class ⇒ Object
19 |
# File 'lib/omnibot/workflow_run.rb', line 19 def workflow_class = type.constantize |