Class: RailsWorkflow::OperationExecutionJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/rails_workflow/operation_execution_job.rb

Overview

Rails workflow operation can run in background (if is_background = true). This job is responsible for performing operation in background.

Instance Method Summary collapse

Instance Method Details

#configObject



17
18
19
# File 'app/jobs/rails_workflow/operation_execution_job.rb', line 17

def config
  RailsWorkflow.config
end

#operation_runnerObject



21
22
23
# File 'app/jobs/rails_workflow/operation_execution_job.rb', line 21

def operation_runner
  config.operation_runner
end

#perform(*args) ⇒ Object



10
11
12
13
14
15
# File 'app/jobs/rails_workflow/operation_execution_job.rb', line 10

def perform(*args)
  operation_id = args[0]

  operation = Operation.find operation_id
  operation_runner.new(operation).execute_in_transaction
end