Class: AWS::SimpleWorkflow::WorkflowTypeCollection

Inherits:
TypeCollection show all
Defined in:
lib/aws/simple_workflow/workflow_type_collection.rb

Instance Attribute Summary

Attributes inherited from TypeCollection

#domain

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods inherited from TypeCollection

#[], #deprecated, #initialize, #named, #reverse_order

Methods included from Core::Collection::Limitable

#each_batch

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Methods included from Core::Model

#client, #config_prefix, #initialize, #inspect

Constructor Details

This class inherits a constructor from AWS::SimpleWorkflow::TypeCollection

Instance Method Details

#register(name, version, options = {}) ⇒ Object Also known as: create

Registers a new workflow type and its configuration settings for in the current domain.

Parameters:

  • name (String)

    The name of the workflow type.

  • version (String)

    The version of the workflow type. The workflow type consists of the name and version, the combination of which must be unique within the domain.

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :default_child_policy (Symbol) — default: nil

    Specifies the default policy to use for the child workflow executions when a workflow execution of this type is terminated. This default can be overridden when starting a workflow execution. The supported child policies are:

    • :terminate - the child executions will be terminated.

    • :request_cancel - a request to cancel will be attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.

    • :abandon - no action will be taken. The child executions will continue to run.

  • :default_execution_start_to_close_timeout (Integer, :none) — default: nil

    The default maximum duration for executions of this workflow type. You can override this default when starting an execution.

    The value should be a number of seconds (integer) or the symbol :none (implying no timeout).

  • :default_task_list (String) — default: nil

    Specifies the default task list to use for scheduling decision tasks for executions of this workflow type. This default is used only if a task list is not provided when starting the workflow execution.

  • :default_task_start_to_close_timeout (Integer, :none) — default: nil

    The default maximum duration of decision tasks for this workflow type.

    The value should be a number of seconds (integer) or the symbol :none (implying no timeout).

  • :description (String) — default: nil

    Textual description of the workflow type.


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/aws/simple_workflow/workflow_type_collection.rb', line 66

def register name, version, options = {}

  options[:domain] = domain.name
  options[:name] = name
  options[:version] = version

  upcase_opts(options, :default_child_policy)

  duration_opts(options, 
    :default_execution_start_to_close_timeout,
    :default_task_start_to_close_timeout)

  if task_list = options[:default_task_list]
    options[:default_task_list] = { :name => task_list.to_s }
  end

  client.register_workflow_type(options)

  self[name, version]
  
end