Class: Roast::Workflow::WorkflowExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/roast/workflow/workflow_execution_context.rb

Overview

Manages execution context across pre-processing, target workflows, and post-processing phases

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorkflowExecutionContext

Returns a new instance of WorkflowExecutionContext.



9
10
11
12
# File 'lib/roast/workflow/workflow_execution_context.rb', line 9

def initialize
  @pre_processing_output = OutputManager.new
  @target_outputs = {}
end

Instance Attribute Details

#pre_processing_outputObject (readonly)

Returns the value of attribute pre_processing_output.



7
8
9
# File 'lib/roast/workflow/workflow_execution_context.rb', line 7

def pre_processing_output
  @pre_processing_output
end

#target_outputsObject (readonly)

Returns the value of attribute target_outputs.



7
8
9
# File 'lib/roast/workflow/workflow_execution_context.rb', line 7

def target_outputs
  @target_outputs
end

Instance Method Details

#add_target_output(target, output_manager) ⇒ Object

Add output from a target workflow execution



15
16
17
18
# File 'lib/roast/workflow/workflow_execution_context.rb', line 15

def add_target_output(target, output_manager)
  target_key = generate_target_key(target)
  @target_outputs[target_key] = output_manager
end

#to_hObject

Get all data as a hash for post-processing



21
22
23
24
25
26
# File 'lib/roast/workflow/workflow_execution_context.rb', line 21

def to_h
  {
    pre_processing: @pre_processing_output.to_h,
    targets: @target_outputs.transform_values(&:to_h),
  }
end