class Dynflow::Director::FinalizeWorkItem

Attributes

finalize_steps_data[R]

Public Class Methods

new(execution_plan_id, queue, sender_orchestrator_id, finalize_steps_data = nil) click to toggle source

@param finalize_steps_data - used to pass the result steps from the worker back to orchestrator

Calls superclass method Dynflow::Director::WorkItem::new
# File lib/dynflow/director.rb, line 135
def initialize(execution_plan_id, queue, sender_orchestrator_id, finalize_steps_data = nil)
  super(execution_plan_id, queue, sender_orchestrator_id)
  @finalize_steps_data = finalize_steps_data
end
new_from_hash(hash, *_args) click to toggle source
# File lib/dynflow/director.rb, line 151
def self.new_from_hash(hash, *_args)
  self.new(*hash.values_at(:execution_plan_id, :queue, :sender_orchestrator_id, :finalize_steps_data))
end

Public Instance Methods

execute() click to toggle source
# File lib/dynflow/director.rb, line 140
def execute
  execution_plan = world.persistence.load_execution_plan(execution_plan_id)
  manager = Director::SequentialManager.new(world, execution_plan)
  manager.finalize
  @finalize_steps_data = manager.finalize_steps.map(&:to_hash)
end
to_hash() click to toggle source
Calls superclass method Dynflow::Director::WorkItem#to_hash
# File lib/dynflow/director.rb, line 147
def to_hash
  super.merge(finalize_steps_data: @finalize_steps_data)
end