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.



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

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.



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

def step
  @step
end

Class Method Details

.new_from_hash(hash, *_args) ⇒ Object



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

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



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

def execute
  @step.execute(nil)
end

#to_hashObject



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

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