Class: Omnibot::WorkflowRun

Inherits:
ActiveRecord::Base
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#repliesObject

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

Returns:

  • (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

Returns:

  • (Boolean)


18
# File 'lib/omnibot/workflow_run.rb', line 18

def terminal? = TERMINAL_STATUSES.include?(status)

#workflow_classObject



19
# File 'lib/omnibot/workflow_run.rb', line 19

def workflow_class = type.constantize