Module: SimplerWorkflow

Extended by:
SimplerWorkflow
Included in:
SimplerWorkflow
Defined in:
lib/simpler_workflow/default_exception_reporter.rb,
lib/simpler_workflow.rb,
lib/simpler_workflow/domain.rb,
lib/simpler_workflow/version.rb,
lib/simpler_workflow/activity.rb,
lib/simpler_workflow/workflow.rb,
lib/simpler_workflow/options_as_methods.rb,
lib/simpler_workflow/workflow_collection.rb

Overview

Default exception handler. Just logs to the logger and re-raise so the exception can be managed as usual.

Defined Under Namespace

Modules: OptionsAsMethods Classes: Activity, DefaultExceptionReporter, Domain, Workflow, WorkflowCollection

Constant Summary collapse

VERSION =
"0.1.12"

Instance Method Summary collapse

Instance Method Details

#domain(domain_name) ⇒ Object



8
9
10
11
# File 'lib/simpler_workflow.rb', line 8

def domain(domain_name)
  @domains ||= {}
  @domains[domain_name.to_sym] ||= Domain.new(domain_name)
end

#exception_reporter(&block) ⇒ Object



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

def exception_reporter(&block)
  if block_given?
    @exception_reporter = DefaultExceptionReporter.new(&block)
  end

  @exception_reporter || DefaultExceptionReporter.new
end

#exception_reporter=(exception_handler) ⇒ Object



29
30
31
# File 'lib/simpler_workflow.rb', line 29

def exception_reporter=(exception_handler)
  @exception_reporter = exception_handler
end

#loggerObject



17
18
19
# File 'lib/simpler_workflow.rb', line 17

def logger
  $logger || Rails.logger
end

#swfObject



13
14
15
# File 'lib/simpler_workflow.rb', line 13

def swf
  @swf ||= ::AWS::SimpleWorkflow.new
end