Class: AWS::SimpleWorkflow::WorkflowType
- Defined in:
- lib/aws/simple_workflow/workflow_type.rb
Overview
Registering a WorkflowType
To register a workflow type you should use the #workflow_types method on the domain:
domain.workflow_types.register('name', 'version', { ... })
See AWS::SimpleWorkflow::WorkflowTypeCollection#register for a complete list of options.
Deprecating a workflow type
WorkflowType inherits from the generic Type base class. Defined in Type are a few useful methods including:
You can use these to deprecate a workflow type:
domain.workflow_types['name','version'].deprecate
Instance Attribute Summary collapse
-
#creation_date ⇒ Time
readonly
When the workflow type was registered.
-
#default_child_policy ⇒ Symbol?
readonly
Specifies the default policy to use for the child workflow executions when a workflow execution of this type is terminated.
-
#default_execution_start_to_close_timeout ⇒ Integer, ...
readonly
The default maximum duration for executions of this workflow type.
-
#default_task_list ⇒ String?
readonly
Specifies the default task list to use for scheduling decision tasks for executions of this workflow type.
-
#default_task_start_to_close_timeout ⇒ Integer, ...
readonly
The default maximum duration of decision tasks for this workflow type.
-
#deprecation_date ⇒ Time?
readonly
When the workflow type was deprecated, or nil if the workflow type has not been deprecated.
-
#description ⇒ String?
readonly
The description of this workflow type, or nil if was not set when it was registered.
-
#status ⇒ Symbol
readonly
The status of this workflow type.
Attributes inherited from Type
Instance Method Summary collapse
-
#count_executions(options = {}) ⇒ Integer
Returns a count of workflow executions of this workflow type.
-
#start_execution(options = {}) ⇒ WorkflowExecution
Returns the new workflow execution.
-
#workflow_executions ⇒ WorkflowExecutionCollection
Returns a collection that enumerates only workflow executions of this type.
Methods inherited from Type
#deprecate, #deprecated?, #initialize
Constructor Details
This class inherits a constructor from AWS::SimpleWorkflow::Type
Instance Attribute Details
#creation_date ⇒ Time (readonly)
When the workflow type was registered.
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def creation_date @creation_date end |
#default_child_policy ⇒ Symbol? (readonly)
Specifies the default policy to use for the child workflow executions when a workflow execution of this type is terminated. Values may be one of the following (or nil):
-
: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.
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def default_child_policy @default_child_policy end |
#default_execution_start_to_close_timeout ⇒ Integer, ... (readonly)
The default maximum duration for executions of this workflow type.
The return value may be an integer (number of seconds), the symbol :none
(implying no timeout) or nil
(not specified).
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def default_execution_start_to_close_timeout @default_execution_start_to_close_timeout end |
#default_task_list ⇒ String? (readonly)
Specifies the default task list to use for scheduling decision tasks for executions of this workflow type.
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def default_task_list @default_task_list end |
#default_task_start_to_close_timeout ⇒ Integer, ... (readonly)
The default maximum duration of decision tasks for this workflow type.
The return value may be an integer (number of seconds), the symbol :none
(implying no timeout) or nil
(not specified).
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def default_task_start_to_close_timeout @default_task_start_to_close_timeout end |
#deprecation_date ⇒ Time? (readonly)
When the workflow type was deprecated, or nil if the workflow type has not been deprecated.
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def deprecation_date @deprecation_date end |
#description ⇒ String? (readonly)
The description of this workflow type, or nil if was not set when it was registered.
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def description @description end |
#status ⇒ Symbol (readonly)
The status of this workflow type. The status will either be :registered
or :deprecated
.
82 83 84 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 82 def status @status end |
Instance Method Details
#count_executions(options = {}) ⇒ Integer
See AWS::SimpleWorkflow::WorkflowExecutionCollection#count for a broader count.
This operation is eventually consistent. The results are best effort and may not exactly reflect recent updates and changes.
Returns a count of workflow executions of this workflow type.
domain.workflow_types['name','version'].count
143 144 145 146 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 143 def count_executions = {} [:workflow_type] = self domain.workflow_executions.count() end |
#start_execution(options = {}) ⇒ WorkflowExecution
Returns the new workflow execution.
122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 122 def start_execution = {} [:domain] = domain.name start_execution_opts(, self) response = client.start_workflow_execution() workflow_id = [:workflow_id] run_id = response.data['runId'] domain.workflow_executions[workflow_id, run_id] end |
#workflow_executions ⇒ WorkflowExecutionCollection
Returns a collection that enumerates only workflow executions of this type.
150 151 152 |
# File 'lib/aws/simple_workflow/workflow_type.rb', line 150 def workflow_executions WorkflowExecutionCollection.new(domain).with_workflow_type(self) end |