class Dynflow::ExecutionPlan::Steps::RunStep

Public Class Methods

state_transitions() click to toggle source
# File lib/dynflow/execution_plan/steps/run_step.rb, line 6
def self.state_transitions
  @state_transitions ||= {
      pending:   [:running, :skipped, :error], # :skipped when it cannot be run because it depends on skipping step
      running:   [:success, :error, :suspended],
      success:   [:suspended], # after not-done process_update
      suspended: [:running, :error], # process_update, e.g. error in setup_progress_updates
      skipping:  [:error, :skipped], # waiting for the skip method to be called
      skipped:   [],
      error:     [:skipping, :running]
  }
end

Public Instance Methods

cancellable?() click to toggle source
# File lib/dynflow/execution_plan/steps/run_step.rb, line 27
def cancellable?
  [:suspended, :running].include?(self.state) &&
    self.action_class < Action::Cancellable
end
mark_to_skip() click to toggle source
# File lib/dynflow/execution_plan/steps/run_step.rb, line 36
def mark_to_skip
  case self.state
  when :error
    self.state = :skipping
  when :pending
    self.state = :skipped
  else
    raise "Skipping step in #{self.state} is not supported"
  end
  self.save
end
phase() click to toggle source
# File lib/dynflow/execution_plan/steps/run_step.rb, line 23
def phase
  Action::Run
end
update_from_action(action) click to toggle source
# File lib/dynflow/execution_plan/steps/run_step.rb, line 18
def update_from_action(action)
  super
  self.progress_weight = action.run_progress_weight
end
with_sub_plans?() click to toggle source
# File lib/dynflow/execution_plan/steps/run_step.rb, line 32
def with_sub_plans?
  self.action_class < Action::WithSubPlans
end