Class: Temporal::Metadata::WorkflowTask

Inherits:
Base
  • Object
show all
Defined in:
lib/temporal/metadata/workflow_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#activity?, #workflow?

Constructor Details

#initialize(namespace:, id:, task_token:, attempt:, workflow_run_id:, workflow_id:, workflow_name:) ⇒ WorkflowTask

Returns a new instance of WorkflowTask.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/temporal/metadata/workflow_task.rb', line 8

def initialize(namespace:, id:, task_token:, attempt:, workflow_run_id:, workflow_id:, workflow_name:)
  @namespace = namespace
  @id = id
  @task_token = task_token
  @attempt = attempt
  @workflow_run_id = workflow_run_id
  @workflow_id = workflow_id
  @workflow_name = workflow_name

  freeze
end

Instance Attribute Details

#attemptObject (readonly)

Returns the value of attribute attempt.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def attempt
  @attempt
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def id
  @id
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def namespace
  @namespace
end

#task_tokenObject (readonly)

Returns the value of attribute task_token.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def task_token
  @task_token
end

#workflow_idObject (readonly)

Returns the value of attribute workflow_id.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def workflow_id
  @workflow_id
end

#workflow_nameObject (readonly)

Returns the value of attribute workflow_name.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def workflow_name
  @workflow_name
end

#workflow_run_idObject (readonly)

Returns the value of attribute workflow_run_id.



6
7
8
# File 'lib/temporal/metadata/workflow_task.rb', line 6

def workflow_run_id
  @workflow_run_id
end

Instance Method Details

#to_hObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/temporal/metadata/workflow_task.rb', line 24

def to_h
  {
    'namespace' => namespace,
    'workflow_task_id' => id,
    'workflow_name' => workflow_name,
    'workflow_id' => workflow_id,
    'workflow_run_id' => workflow_run_id,
    'attempt' => attempt
  }
end

#workflow_task?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/temporal/metadata/workflow_task.rb', line 20

def workflow_task?
  true
end