Class: Temporalio::Workflow::ExecutionInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/temporalio/workflow/execution_info.rb

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



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def close_time
  @close_time
end

#execution_timeObject

Returns the value of attribute execution_time

Returns:

  • (Object)

    the current value of execution_time



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def execution_time
  @execution_time
end

#history_lengthObject

Returns the value of attribute history_length

Returns:

  • (Object)

    the current value of history_length



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def history_length
  @history_length
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def id
  @id
end

#memoObject

Returns the value of attribute memo

Returns:

  • (Object)

    the current value of memo



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def memo
  @memo
end

#parent_idObject

Returns the value of attribute parent_id

Returns:

  • (Object)

    the current value of parent_id



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def parent_id
  @parent_id
end

#parent_run_idObject

Returns the value of attribute parent_run_id

Returns:

  • (Object)

    the current value of parent_run_id



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def parent_run_id
  @parent_run_id
end

#rawObject

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def raw
  @raw
end

#run_idObject

Returns the value of attribute run_id

Returns:

  • (Object)

    the current value of run_id



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def run_id
  @run_id
end

#search_attributesObject

Returns the value of attribute search_attributes

Returns:

  • (Object)

    the current value of search_attributes



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def search_attributes
  @search_attributes
end

#start_timeObject

Returns the value of attribute start_time

Returns:

  • (Object)

    the current value of start_time



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def start_time
  @start_time
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def status
  @status
end

#task_queueObject

Returns the value of attribute task_queue

Returns:

  • (Object)

    the current value of task_queue



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def task_queue
  @task_queue
end

#workflowObject

Returns the value of attribute workflow

Returns:

  • (Object)

    the current value of workflow



7
8
9
# File 'lib/temporalio/workflow/execution_info.rb', line 7

def workflow
  @workflow
end

Class Method Details

.from_raw(response, converter) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/temporalio/workflow/execution_info.rb', line 24

def self.from_raw(response, converter)
  raw_info = response.workflow_execution_info
  raise Temporalio::Error::UnexpectedResponse, 'missing workflow_execution_info' unless raw_info

  new(
    raw: response,
    workflow: raw_info.type&.name,
    id: raw_info.execution&.workflow_id,
    run_id: raw_info.execution&.run_id,
    task_queue: raw_info.task_queue,
    status: Workflow::ExecutionStatus.from_raw(raw_info.status),
    parent_id: raw_info.parent_execution&.workflow_id,
    parent_run_id: raw_info.parent_execution&.run_id,
    start_time: raw_info.start_time&.to_time,
    close_time: raw_info.close_time&.to_time,
    execution_time: raw_info.execution_time&.to_time,
    history_length: raw_info.history_length,
    memo: converter.from_payload_map(raw_info.memo&.fields),
    search_attributes: converter.from_payload_map(raw_info.search_attributes&.indexed_fields),
  ).freeze
end