Class: Conductor::Http::Models::Workflow
- Defined in:
- lib/conductor/http/models/workflow.rb
Overview
Workflow execution model representing a running or completed workflow instance
Constant Summary collapse
- SWAGGER_TYPES =
{ workflow_id: 'String', parent_workflow_id: 'String', parent_workflow_task_id: 'String', correlation_id: 'String', workflow_name: 'String', workflow_version: 'Integer', workflow_definition: 'WorkflowDef', status: 'String', input: 'Hash<String, Object>', output: 'Hash<String, Object>', tasks: 'Array<Task>', start_time: 'Integer', end_time: 'Integer', update_time: 'Integer', variables: 'Hash<String, Object>', external_input_payload_storage_path: 'String', external_output_payload_storage_path: 'String', priority: 'Integer', task_to_domain: 'Hash<String, String>', failed_reference_task_names: 'Array<String>', reason_for_incompletion: 'String', owner_app: 'String', created_by: 'String', event: 'String', last_retried_time: 'Integer' }.freeze
- ATTRIBUTE_MAP =
{ workflow_id: :workflowId, parent_workflow_id: :parentWorkflowId, parent_workflow_task_id: :parentWorkflowTaskId, correlation_id: :correlationId, workflow_name: :workflowName, workflow_version: :workflowVersion, workflow_definition: :workflowDefinition, status: :status, input: :input, output: :output, tasks: :tasks, start_time: :startTime, end_time: :endTime, update_time: :updateTime, variables: :variables, external_input_payload_storage_path: :externalInputPayloadStoragePath, external_output_payload_storage_path: :externalOutputPayloadStoragePath, priority: :priority, task_to_domain: :taskToDomain, failed_reference_task_names: :failedReferenceTaskNames, reason_for_incompletion: :reasonForIncompletion, owner_app: :ownerApp, created_by: :createdBy, event: :event, last_retried_time: :lastRetriedTime }.freeze
Instance Attribute Summary collapse
-
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
-
#created_by ⇒ Object
Returns the value of attribute created_by.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#event ⇒ Object
Returns the value of attribute event.
-
#external_input_payload_storage_path ⇒ Object
Returns the value of attribute external_input_payload_storage_path.
-
#external_output_payload_storage_path ⇒ Object
Returns the value of attribute external_output_payload_storage_path.
-
#failed_reference_task_names ⇒ Object
Returns the value of attribute failed_reference_task_names.
-
#input ⇒ Object
Returns the value of attribute input.
-
#last_retried_time ⇒ Object
Returns the value of attribute last_retried_time.
-
#output ⇒ Object
Returns the value of attribute output.
-
#owner_app ⇒ Object
Returns the value of attribute owner_app.
-
#parent_workflow_id ⇒ Object
Returns the value of attribute parent_workflow_id.
-
#parent_workflow_task_id ⇒ Object
Returns the value of attribute parent_workflow_task_id.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#reason_for_incompletion ⇒ Object
Returns the value of attribute reason_for_incompletion.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status ⇒ Object
Returns the value of attribute status.
-
#task_to_domain ⇒ Object
Returns the value of attribute task_to_domain.
-
#tasks ⇒ Object
Returns the value of attribute tasks.
-
#update_time ⇒ Object
Returns the value of attribute update_time.
-
#variables ⇒ Object
Returns the value of attribute variables.
-
#workflow_definition ⇒ Object
Returns the value of attribute workflow_definition.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
-
#workflow_name ⇒ Object
Returns the value of attribute workflow_name.
-
#workflow_version ⇒ Object
Returns the value of attribute workflow_version.
Instance Method Summary collapse
-
#completed? ⇒ Boolean
Check if workflow completed successfully.
-
#failed? ⇒ Boolean
Check if workflow failed.
-
#initialize(params = {}) ⇒ Workflow
constructor
A new instance of Workflow.
-
#paused? ⇒ Boolean
Check if workflow is paused.
-
#running? ⇒ Boolean
Check if workflow is running.
-
#task_by_ref(ref_name) ⇒ Task?
Get a task by reference name.
-
#terminal? ⇒ Boolean
Check if workflow is in terminal state.
Methods inherited from BaseModel
attribute_map, deserialize_model, deserialize_value, find_model_class, from_hash, from_json, parse_datetime, swagger_types, #to_h, #to_json
Constructor Details
#initialize(params = {}) ⇒ Workflow
Returns a new instance of Workflow.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/conductor/http/models/workflow.rb', line 74 def initialize(params = {}) @workflow_id = params[:workflow_id] @parent_workflow_id = params[:parent_workflow_id] @parent_workflow_task_id = params[:parent_workflow_task_id] @correlation_id = params[:correlation_id] @workflow_name = params[:workflow_name] @workflow_version = params[:workflow_version] @workflow_definition = params[:workflow_definition] @status = params[:status] @input = params[:input] || {} @output = params[:output] || {} @tasks = params[:tasks] || [] @start_time = params[:start_time] @end_time = params[:end_time] @update_time = params[:update_time] @variables = params[:variables] || {} @external_input_payload_storage_path = params[:external_input_payload_storage_path] @external_output_payload_storage_path = params[:external_output_payload_storage_path] @priority = params[:priority] @task_to_domain = params[:task_to_domain] @failed_reference_task_names = params[:failed_reference_task_names] || [] @reason_for_incompletion = params[:reason_for_incompletion] @owner_app = params[:owner_app] @created_by = params[:created_by] @event = params[:event] @last_retried_time = params[:last_retried_time] end |
Instance Attribute Details
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def correlation_id @correlation_id end |
#created_by ⇒ Object
Returns the value of attribute created_by.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def created_by @created_by end |
#end_time ⇒ Object
Returns the value of attribute end_time.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def end_time @end_time end |
#event ⇒ Object
Returns the value of attribute event.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def event @event end |
#external_input_payload_storage_path ⇒ Object
Returns the value of attribute external_input_payload_storage_path.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def external_input_payload_storage_path @external_input_payload_storage_path end |
#external_output_payload_storage_path ⇒ Object
Returns the value of attribute external_output_payload_storage_path.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def external_output_payload_storage_path @external_output_payload_storage_path end |
#failed_reference_task_names ⇒ Object
Returns the value of attribute failed_reference_task_names.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def failed_reference_task_names @failed_reference_task_names end |
#input ⇒ Object
Returns the value of attribute input.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def input @input end |
#last_retried_time ⇒ Object
Returns the value of attribute last_retried_time.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def last_retried_time @last_retried_time end |
#output ⇒ Object
Returns the value of attribute output.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def output @output end |
#owner_app ⇒ Object
Returns the value of attribute owner_app.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def owner_app @owner_app end |
#parent_workflow_id ⇒ Object
Returns the value of attribute parent_workflow_id.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def parent_workflow_id @parent_workflow_id end |
#parent_workflow_task_id ⇒ Object
Returns the value of attribute parent_workflow_task_id.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def parent_workflow_task_id @parent_workflow_task_id end |
#priority ⇒ Object
Returns the value of attribute priority.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def priority @priority end |
#reason_for_incompletion ⇒ Object
Returns the value of attribute reason_for_incompletion.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def reason_for_incompletion @reason_for_incompletion end |
#start_time ⇒ Object
Returns the value of attribute start_time.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def start_time @start_time end |
#status ⇒ Object
Returns the value of attribute status.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def status @status end |
#task_to_domain ⇒ Object
Returns the value of attribute task_to_domain.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def task_to_domain @task_to_domain end |
#tasks ⇒ Object
Returns the value of attribute tasks.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def tasks @tasks end |
#update_time ⇒ Object
Returns the value of attribute update_time.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def update_time @update_time end |
#variables ⇒ Object
Returns the value of attribute variables.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def variables @variables end |
#workflow_definition ⇒ Object
Returns the value of attribute workflow_definition.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def workflow_definition @workflow_definition end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def workflow_id @workflow_id end |
#workflow_name ⇒ Object
Returns the value of attribute workflow_name.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def workflow_name @workflow_name end |
#workflow_version ⇒ Object
Returns the value of attribute workflow_version.
64 65 66 |
# File 'lib/conductor/http/models/workflow.rb', line 64 def workflow_version @workflow_version end |
Instance Method Details
#completed? ⇒ Boolean
Check if workflow completed successfully
110 111 112 |
# File 'lib/conductor/http/models/workflow.rb', line 110 def completed? status == WorkflowStatusConstants::COMPLETED end |
#failed? ⇒ Boolean
Check if workflow failed
116 117 118 |
# File 'lib/conductor/http/models/workflow.rb', line 116 def failed? status == WorkflowStatusConstants::FAILED end |
#paused? ⇒ Boolean
Check if workflow is paused
128 129 130 |
# File 'lib/conductor/http/models/workflow.rb', line 128 def paused? status == WorkflowStatusConstants::PAUSED end |
#running? ⇒ Boolean
Check if workflow is running
122 123 124 |
# File 'lib/conductor/http/models/workflow.rb', line 122 def running? status == WorkflowStatusConstants::RUNNING end |
#task_by_ref(ref_name) ⇒ Task?
Get a task by reference name
135 136 137 |
# File 'lib/conductor/http/models/workflow.rb', line 135 def task_by_ref(ref_name) tasks&.find { |t| t.reference_task_name == ref_name } end |
#terminal? ⇒ Boolean
Check if workflow is in terminal state
104 105 106 |
# File 'lib/conductor/http/models/workflow.rb', line 104 def terminal? WorkflowStatusConstants.terminal?(status) end |