Class: Cadence::Workflow::ExecutionInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/cadence/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
VALID_STATUSES =
[
  RUNNING_STATUS,
  COMPLETED_STATUS,
  FAILED_STATUS,
  CANCELED_STATUS,
  TERMINATED_STATUS,
  CONTINUED_AS_NEW_STATUS,
  TIMED_OUT_STATUS
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#close_timeObject

Returns the value of attribute close_time

Returns:

  • (Object)

    the current value of close_time



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def close_time
  @close_time
end

#history_lengthObject

Returns the value of attribute history_length

Returns:

  • (Object)

    the current value of history_length



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def history_length
  @history_length
end

#run_idObject

Returns the value of attribute run_id

Returns:

  • (Object)

    the current value of run_id



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def run_id
  @run_id
end

#start_timeObject

Returns the value of attribute start_time

Returns:

  • (Object)

    the current value of start_time



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def start_time
  @start_time
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def status
  @status
end

#workflowObject

Returns the value of attribute workflow

Returns:

  • (Object)

    the current value of workflow



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def workflow
  @workflow
end

#workflow_idObject

Returns the value of attribute workflow_id

Returns:

  • (Object)

    the current value of workflow_id



5
6
7
# File 'lib/cadence/workflow/execution_info.rb', line 5

def workflow_id
  @workflow_id
end

Class Method Details

.generate_from(response) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cadence/workflow/execution_info.rb', line 24

def self.generate_from(response)
  status = ::CadenceThrift::WorkflowExecutionCloseStatus::VALUE_MAP[response.closeStatus]

  new(
    workflow: response.type.name,
    workflow_id: response.execution.workflowId,
    run_id: response.execution.runId,
    start_time: Utils.time_from_nanos(response.startTime),
    close_time: Utils.time_from_nanos(response.closeTime),
    status: status&.to_sym || RUNNING_STATUS,
    history_length: response.historyLength,
  ).freeze
end