class Proxy::Dynflow::TaskLauncher::Abstract

Attributes

callback[R]
options[R]
results[R]
world[R]

Public Class Methods

input_format() click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 19
def self.input_format; end
new(world, callback, options = {}) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 8
def initialize(world, callback, options = {})
  @world = world
  @callback = callback
  @options = options
  @results = {}
end
new_from_hash(world, hash) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 25
def self.new_from_hash(world, hash)
  ::Dynflow::Utils.constantize(hash[:class]).new(world, hash[:callback], hash[:options])
end

Public Instance Methods

launch!(_input) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 15
def launch!(_input)
  raise NotImplementedError
end
to_hash() click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 21
def to_hash
  { :class => self.class.to_s, :callback => callback, :options => options }
end

Private Instance Methods

action_class(input) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 40
def action_class(input)
  options[:action_class_override] || ::Dynflow::Utils.constantize(input['action_class'])
end
format_result(result) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 31
def format_result(result)
  if result.triggered?
    { :result => 'success', :task_id => result.execution_plan_id }
  else
    plan = world.persistence.load_execution_plan(result.id)
    { :result => 'error', :errors => plan.errors }
  end
end
trigger(parent, klass, *input, id: nil) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 48
def trigger(parent, klass, *input, id: nil)
  world.trigger do
    world.plan_with_options(caller_action: parent, action_class: klass, args: input, id: id)
  end
end
with_callback(input) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 44
def with_callback(input)
  input.merge(:callback_host => callback)
end