class BusinessFlow::InstrumentedStepExecutor

Fire ActiveSupport events for every step that's run and on errors

Protected Instance Methods

event_name(step) click to toggle source
# File lib/business_flow/instrumented_step_executor.rb, line 19
def event_name(step)
  "business_flow.step.#{step_event_name(step)}"
end
execute_step(step) click to toggle source
# File lib/business_flow/instrumented_step_executor.rb, line 6
def execute_step(step)
  i_name = event_name(step)
  i_payload = { flow: flow, step: step }
  ActiveSupport::Notifications.instrument(i_name, i_payload) do |payload|
    payload[:step_result] = super
  end
  notify_errors(i_name, i_payload)
end
step_event_name(step) click to toggle source
# File lib/business_flow/instrumented_step_executor.rb, line 15
def step_event_name(step)
  "#{flow_name}.#{step.to_s.underscore}"
end