Class: Actions::ActionWithSubPlans

Inherits:
EntryAction show all
Includes:
Dynflow::Action::WithSubPlans
Defined in:
app/lib/actions/action_with_sub_plans.rb

Direct Known Subclasses

BulkAction

Instance Method Summary collapse

Methods inherited from EntryAction

#action_subject, all_action_names, #delay, #humanized_input, #humanized_name, #resource_locks, serializer_class

Methods included from Helpers::Lock

#exclusive_lock!, #link!, #lock!

Methods included from Helpers::ArgsSerialization

#serialize_args

Methods inherited from Base

#already_running?, #humanized_errors, #humanized_input, #humanized_name, #serializer_class, #task, #task_input, #task_output

Instance Method Details

#humanized_outputObject



13
14
15
16
17
18
19
# File 'app/lib/actions/action_with_sub_plans.rb', line 13

def humanized_output
  return unless counts_set?
  _("%{total} task(s), %{success} success, %{failed} fail") %
      { total:   output[:total_count],
        success: output[:success_count],
        failed:  output[:failed_count] }
end

#plan(*args) ⇒ Object

Raises:

  • (NotImplementedError)


9
10
11
# File 'app/lib/actions/action_with_sub_plans.rb', line 9

def plan(*args)
  raise NotImplementedError
end

#run_progressObject



21
22
23
24
25
26
27
# File 'app/lib/actions/action_with_sub_plans.rb', line 21

def run_progress
  if counts_set? && output[:total_count] > 0
    (output[:success_count] + output[:failed_count]).to_f / output[:total_count]
  else
    0.1
  end
end