Class: Dynflow::ExecutionPlan::Steps::AbstractFlowStep

Inherits:
Abstract show all
Defined in:
lib/dynflow/execution_plan/steps/abstract_flow_step.rb

Direct Known Subclasses

FinalizeStep, RunStep

Constant Summary

Constants inherited from Serializable

Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT

Instance Attribute Summary

Attributes inherited from Abstract

#action_class, #action_id, #delayed_events, #ended_at, #error, #execution_plan_id, #execution_time, #id, #progress_weight, #queue, #real_time, #started_at, #state, #world

Attributes included from Stateful

#state

Instance Method Summary collapse

Methods inherited from Abstract

#==, #action, #action_logger, #cancellable?, #default_progress_done, #initialize, #mark_to_skip, #persistence, #phase, #progress_done, #save, #skippable?, states, #to_hash, #to_s, #with_sub_plans?

Methods included from Stateful

included, #set_state, #state_transitions, #states

Methods inherited from Serializable

constantize, from_hash, new_from_hash, #to_hash

Constructor Details

This class inherits a constructor from Dynflow::ExecutionPlan::Steps::Abstract

Instance Method Details

#cloneObject



24
25
26
# File 'lib/dynflow/execution_plan/steps/abstract_flow_step.rb', line 24

def clone
  self.class.from_hash(to_hash, execution_plan_id, world)
end

#execute(*args) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/dynflow/execution_plan/steps/abstract_flow_step.rb', line 14

def execute(*args)
  return self if [:skipped, :success].include? self.state
  open_action do |action|
    with_meta_calculation(action) do
      action.execute(*args)
      @delayed_events = action.delayed_events
    end
  end
end

#update_from_action(action) ⇒ Object

Method called when initializing the step to customize the behavior based on the action definition during the planning phase



8
9
10
11
12
# File 'lib/dynflow/execution_plan/steps/abstract_flow_step.rb', line 8

def update_from_action(action)
  @queue = action.queue
  @queue ||= action.triggering_action.queue if action.triggering_action
  @queue ||= :default
end