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 16
def self.input_format; end
new(world, callback, options = {}) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 5
def initialize(world, callback, options = {})
  @world = world
  @callback = callback
  @options = options
  @results = {}
end

Public Instance Methods

launch!(_input) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 12
def launch!(_input)
  raise NotImplementedError
end

Private Instance Methods

action_class(input) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 29
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 20
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) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 37
def trigger(parent, klass, *input)
  world.trigger do
    world.plan_with_options(caller_action: parent, action_class: klass, args: input)
  end
end
with_callback(input) click to toggle source
# File lib/smart_proxy_dynflow/task_launcher/abstract.rb, line 33
def with_callback(input)
  input.merge(:callback_host => callback)
end