Class: Temporal::Workflow::ExecutionInfo
- Inherits:
-
Struct
- Object
- Struct
- Temporal::Workflow::ExecutionInfo
- Defined in:
- lib/temporal/workflow/execution_info.rb
Constant Summary collapse
- RUNNING_STATUS =
:RUNNING
- COMPLETED_STATUS =
:COMPLETED
- FAILED_STATUS =
:FAILED
- CANCELED_STATUS =
:CANCELED
- TERMINATED_STATUS =
:TERMINATED
- CONTINUED_AS_NEW_STATUS =
:CONTINUED_AS_NEW
- TIMED_OUT_STATUS =
:TIMED_OUT
- API_STATUS_MAP =
{ WORKFLOW_EXECUTION_STATUS_RUNNING: RUNNING_STATUS, WORKFLOW_EXECUTION_STATUS_COMPLETED: COMPLETED_STATUS, WORKFLOW_EXECUTION_STATUS_FAILED: FAILED_STATUS, WORKFLOW_EXECUTION_STATUS_CANCELED: CANCELED_STATUS, WORKFLOW_EXECUTION_STATUS_TERMINATED: TERMINATED_STATUS, WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW: CONTINUED_AS_NEW_STATUS, WORKFLOW_EXECUTION_STATUS_TIMED_OUT: TIMED_OUT_STATUS }.freeze
- VALID_STATUSES =
[ RUNNING_STATUS, COMPLETED_STATUS, FAILED_STATUS, CANCELED_STATUS, TERMINATED_STATUS, CONTINUED_AS_NEW_STATUS, TIMED_OUT_STATUS ].freeze
Instance Attribute Summary collapse
-
#close_time ⇒ Object
Returns the value of attribute close_time.
-
#history_length ⇒ Object
Returns the value of attribute history_length.
-
#run_id ⇒ Object
Returns the value of attribute run_id.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status ⇒ Object
Returns the value of attribute status.
-
#workflow ⇒ Object
Returns the value of attribute workflow.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
Class Method Summary collapse
Instance Attribute Details
#close_time ⇒ Object
Returns the value of attribute close_time
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def close_time @close_time end |
#history_length ⇒ Object
Returns the value of attribute history_length
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def history_length @history_length end |
#run_id ⇒ Object
Returns the value of attribute run_id
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def run_id @run_id end |
#start_time ⇒ Object
Returns the value of attribute start_time
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def start_time @start_time end |
#status ⇒ Object
Returns the value of attribute status
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def status @status end |
#workflow ⇒ Object
Returns the value of attribute workflow
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def workflow @workflow end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id
3 4 5 |
# File 'lib/temporal/workflow/execution_info.rb', line 3 def workflow_id @workflow_id end |
Class Method Details
.generate_from(response) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/temporal/workflow/execution_info.rb', line 32 def self.generate_from(response) new( workflow: response.type.name, workflow_id: response.execution.workflow_id, run_id: response.execution.run_id, start_time: response.start_time&.to_time, close_time: response.close_time&.to_time, status: API_STATUS_MAP.fetch(response.status), history_length: response.history_length, ).freeze end |