class AWS::SimpleWorkflow::HistoryEvent


with the returned attributes.
See {HistoryEvent::Attributes} for more information about working

event.attributes[‘workflowType’]
event.attributes.workflow_type
by their snake_case name or their camelCase name:
structure returned by {#attributes} allows you to access attributes
Because the service returns attributes with camelCase name the
returned with each event type, see the service API documentation.
For a complete list of event types and a complete list of attributes
* {#attributes}
* {#created_at}
* {#event_id}
* {#event_type}
All history events respond to the following 4 methods:
## History Event Attributes
end
end
decision_task.events.each do |event|
workflow_execution.decision_tasks.poll do |decision_task|
* By enumerating events from the context of a {DecisionTask}:
end
# …
workflow_execution.events.each do |event|
* By enumerating events from the execution
from an execution two ways:
History events belong to workflow executions. You can get them
## Getting History Events

def initialize workflow_execution, details

Parameters:
  • details (Hash, String) -- A hash or JSON string describing
  • workflow_execution (WorkflowExecution) --
def initialize workflow_execution, details
  @workflow_execution = workflow_execution
  @details = details.is_a?(String) ? JSON.parse(details) : details
  @event_type = @details['eventType']
  @event_id = @details['eventId']
  @created_at = Time.at(@details['eventTimestamp'])
  attributes_key = "#{event_type}EventAttributes"
  attributes_key[0] = attributes_key[0,1].downcase
  attribute_data = @details[attributes_key] || {}
  @attributes = Attributes.new(workflow_execution, attribute_data)
  super
end

def inspect

Other tags:
    Api: - private
def inspect
  "<#{self.class.name} #{to_h.inspect}>"
end

def to_h

Returns:
  • (Hash) - Returns a hash representation of the event.
def to_h
  {
    :event_type => event_type,
    :event_id => event_id,
    :created_at => created_at,
    :attributes => attributes.to_h,
  }
end

def to_json

Returns:
  • (String) - Returns a JSON representation of this workflow
def to_json
  @details.to_json
end