Module: Reactor::Workflow::Base

Defined in:
lib/reactor/workflow.rb

Overview

This module provides support for Workflow actions and information querying.

Instance Method Summary collapse

Instance Method Details

#workflowObject

Returns instance of Standard (or Empty..) For the API See Reactor::Workflow::Standard



11
12
13
14
15
16
17
18
# File 'lib/reactor/workflow.rb', line 11

def workflow
  @workflow ||=
    if (meta = RailsConnector::ObjectWithMetaData.find_by_object_id(obj_id)).workflow_name.present?
      Standard.new(self, meta)
    else
      Empty.new(self)
    end
end

#workflow_commentsObject



20
21
22
# File 'lib/reactor/workflow.rb', line 20

def workflow_comments
  Reactor::Cm::LogEntry.where(objectId: id).map { |entry| Comment.new(entry) }
end