Module: AWS::Flow::Templates::Utils Private

Defined in:
lib/aws/templates/utilities.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.register_default_result_activity(domain) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers the default result activity type FlowDefaultResultActivityRuby with the Simple Workflow Service



45
46
47
48
49
50
51
52
53
# File 'lib/aws/templates/utilities.rb', line 45

def self.register_default_result_activity(domain)
  worker = AWS::Flow::ActivityWorker.new(
    domain.client,
    domain,
    nil,
    AWS::Flow::Templates.result_activity
  ) {{ use_forking: false }}
  worker.register
end

.register_default_workflow(domain) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers the default workflow type FlowDefaultWorkflowRuby with the Simple Workflow Service



33
34
35
36
37
38
39
40
# File 'lib/aws/templates/utilities.rb', line 33

def self.register_default_workflow(domain)
  AWS::Flow::WorkflowWorker.new(
    domain.client,
    domain,
    nil,
    AWS::Flow::Templates.default_workflow
  ).register
end

.register_defaults(name = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers the relevant defaults with the Simple Workflow Service. If domain name is not provided, it registers the FlowDefault domain



22
23
24
25
26
27
28
# File 'lib/aws/templates/utilities.rb', line 22

def self.register_defaults(name=nil)
  name ||= FlowConstants.defaults[:domain]
  domain = AWS::Flow::Utilities.register_domain(name)

  register_default_workflow(domain)
  register_default_result_activity(domain)
end

.register_on_failure(domain, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method calls the given block. If an UnknownResourceFault is returned, then it tries to register AWS Flow defaults with the service and calls the block again.



10
11
12
13
14
15
16
17
# File 'lib/aws/templates/utilities.rb', line 10

def self.register_on_failure(domain, &block)
  begin
    block.call(domain)
  rescue AWS::SimpleWorkflow::Errors::UnknownResourceFault => e
    register_defaults(domain)
    block.call(domain)
  end
end