Module: Actions::TaskSynchronization
- Included in:
- Base
- Defined in:
- app/lib/actions/task_synchronization.rb
Overview
# Action B which emits an event when it successfully finishes or fails. class B
include ::Actions::ObservableAction
execution_plan_hooks.use :emit_event_failure, :on => [:failure]
def self.event_names
super + [event_name_base + '_' + event_name_suffix(:failure)]
end
def emit_event_failure(plan)
emit_event(plan, :failure)
end
# ... rest ...
end
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
26 27 28 |
# File 'app/lib/actions/task_synchronization.rb', line 26 def self.included(base) base.execution_plan_hooks.use :sync_execution_plan_to_task, on: ::Dynflow::ExecutionPlan.states end |
Instance Method Details
#sync_execution_plan_to_task(plan) ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/lib/actions/task_synchronization.rb', line 30 def sync_execution_plan_to_task(plan) return unless root_action? on_execution_plan_save(plan) rescue => e ::Foreman::Logging.exception('Error on on_execution_plan_save event', e, :logger => 'dynflow') end |