class Temporal::Workflow::History::Event
Constants
- CHILD_WORKFLOW_EVENTS
- EVENT_TYPES
- PREFIX
Attributes
attributes[R]
id[R]
timestamp[R]
type[R]
Public Class Methods
new(raw_event)
click to toggle source
# File lib/temporal/workflow/history/event.rb, line 33 def initialize(raw_event) @id = raw_event.event_id @timestamp = raw_event.event_time.to_time @type = raw_event.event_type.to_s.gsub(PREFIX, '') @attributes = extract_attributes(raw_event) freeze end
Public Instance Methods
originating_event_id()
click to toggle source
Returns the ID of the first event associated with the current event.
# File lib/temporal/workflow/history/event.rb, line 43 def originating_event_id case type when 'TIMER_FIRED' attributes.started_event_id when 'WORKFLOW_EXECUTION_SIGNALED', 'WORKFLOW_EXECUTION_TERMINATED' 1 # fixed id for everything related to current workflow when *EVENT_TYPES attributes.scheduled_event_id when *CHILD_WORKFLOW_EVENTS attributes.initiated_event_id else id end end
Private Instance Methods
extract_attributes(raw_event)
click to toggle source
# File lib/temporal/workflow/history/event.rb, line 60 def extract_attributes(raw_event) attributes_name = raw_event.attributes raw_event.public_send(attributes_name) end