Class: Dynflow::Director::StepWorkItem

Inherits:
WorkItem show all
Defined in:
lib/dynflow/director.rb

Direct Known Subclasses

EventWorkItem

Constant Summary

Constants inherited from Serializable

Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT

Instance Attribute Summary collapse

Attributes inherited from WorkItem

#execution_plan_id, #queue, #sender_orchestrator_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from WorkItem

#world, #world=

Methods inherited from Serializable

constantize, from_hash

Constructor Details

#initialize(execution_plan_id, step, queue, sender_orchestrator_id) ⇒ StepWorkItem

Returns a new instance of StepWorkItem.



63
64
65
66
# File 'lib/dynflow/director.rb', line 63

def initialize(execution_plan_id, step, queue, sender_orchestrator_id)
  super(execution_plan_id, queue, sender_orchestrator_id)
  @step = step
end

Instance Attribute Details

#stepObject (readonly)

Returns the value of attribute step.



61
62
63
# File 'lib/dynflow/director.rb', line 61

def step
  @step
end

Class Method Details

.new_from_hash(hash, *_args) ⇒ Object



76
77
78
79
80
81
# File 'lib/dynflow/director.rb', line 76

def self.new_from_hash(hash, *_args)
  self.new(hash[:execution_plan_id],
           Serializable.from_hash(hash[:step], hash[:execution_plan_id], Dynflow.process_world),
           hash[:queue],
           hash[:sender_orchestrator_id])
end

Instance Method Details

#executeObject



68
69
70
# File 'lib/dynflow/director.rb', line 68

def execute
  @step.execute(nil)
end

#to_hashObject



72
73
74
# File 'lib/dynflow/director.rb', line 72

def to_hash
  super.merge(step: step.to_hash)
end