Class: Roast::Workflow::WorkflowExecutionContext
- Inherits:
-
Object
- Object
- Roast::Workflow::WorkflowExecutionContext
- 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
-
#pre_processing_output ⇒ Object
readonly
Returns the value of attribute pre_processing_output.
-
#target_outputs ⇒ Object
readonly
Returns the value of attribute target_outputs.
Instance Method Summary collapse
-
#add_target_output(target, output_manager) ⇒ Object
Add output from a target workflow execution.
-
#initialize ⇒ WorkflowExecutionContext
constructor
A new instance of WorkflowExecutionContext.
-
#to_h ⇒ Object
Get all data as a hash for post-processing.
Constructor Details
#initialize ⇒ WorkflowExecutionContext
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_output ⇒ Object (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_outputs ⇒ Object (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_h ⇒ Object
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 |