Class: Dynflow::Director::FinalizeWorkItem
- Inherits:
-
WorkItem
- Object
- Serializable
- WorkItem
- Dynflow::Director::FinalizeWorkItem
- Defined in:
- lib/dynflow/director.rb
Constant Summary
Constants inherited from Serializable
Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT
Instance Attribute Summary collapse
-
#finalize_steps_data ⇒ Object
readonly
Returns the value of attribute finalize_steps_data.
Attributes inherited from WorkItem
#execution_plan_id, #queue, #sender_orchestrator_id
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(execution_plan_id, queue, sender_orchestrator_id, finalize_steps_data = nil) ⇒ FinalizeWorkItem
constructor
A new instance of FinalizeWorkItem.
- #to_hash ⇒ Object
Methods inherited from WorkItem
Methods inherited from Serializable
Constructor Details
#initialize(execution_plan_id, queue, sender_orchestrator_id, finalize_steps_data = nil) ⇒ FinalizeWorkItem
Returns a new instance of FinalizeWorkItem.
136 137 138 139 |
# File 'lib/dynflow/director.rb', line 136 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 |
Instance Attribute Details
#finalize_steps_data ⇒ Object (readonly)
Returns the value of attribute finalize_steps_data.
133 134 135 |
# File 'lib/dynflow/director.rb', line 133 def finalize_steps_data @finalize_steps_data end |
Class Method Details
.new_from_hash(hash, *_args) ⇒ Object
152 153 154 |
# File 'lib/dynflow/director.rb', line 152 def self.new_from_hash(hash, *_args) self.new(*hash.values_at(:execution_plan_id, :queue, :sender_orchestrator_id, :finalize_steps_data)) end |
Instance Method Details
#execute ⇒ Object
141 142 143 144 145 146 |
# File 'lib/dynflow/director.rb', line 141 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 ⇒ Object
148 149 150 |
# File 'lib/dynflow/director.rb', line 148 def to_hash super.merge(finalize_steps_data: @finalize_steps_data) end |