Sha256: 6ea6ded5e081203520a011c033bb3354c6a4bbbedd0b8ef4d89209f498279aa2

Contents?: true

Size: 618 Bytes

Versions: 24

Compression:

Stored size: 618 Bytes

Contents

module BusinessFlow
  # Fire ActiveSupport events for every step that's run and on errors
  class InstrumentedStepExecutor < InstrumentedExecutor
    protected

    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

    def step_event_name(step)
      "#{flow_name}.#{step.to_s.underscore}"
    end

    def event_name(step)
      "business_flow.step.#{step_event_name(step)}"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
business_flow-0.17.5 lib/business_flow/instrumented_step_executor.rb
business_flow-0.17.4 lib/business_flow/instrumented_step_executor.rb
business_flow-0.17.3 lib/business_flow/instrumented_step_executor.rb
business_flow-0.17.2 lib/business_flow/instrumented_step_executor.rb
business_flow-0.17.1 lib/business_flow/instrumented_step_executor.rb
business_flow-0.17.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.16.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.15.1 lib/business_flow/instrumented_step_executor.rb
business_flow-0.15.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.14.3 lib/business_flow/instrumented_step_executor.rb
business_flow-0.14.2 lib/business_flow/instrumented_step_executor.rb
business_flow-0.14.1 lib/business_flow/instrumented_step_executor.rb
business_flow-0.14.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.13.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.12.1 lib/business_flow/instrumented_step_executor.rb
business_flow-0.12.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.11.1 lib/business_flow/instrumented_step_executor.rb
business_flow-0.11.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.10.0 lib/business_flow/instrumented_step_executor.rb
business_flow-0.9.1 lib/business_flow/instrumented_step_executor.rb