class AWS::SimpleWorkflow::HistoryEventCollection

This collection represents the history events ({HistoryEvent}) for a single workflow execution.

See {Core::Collection} for documentation on the standard enumerable methods and their options.

Attributes

workflow_execution[R]

@return [WorkflowExectuion]

Public Class Methods

new(workflow_execution, options = {}) click to toggle source

@param [WorkflowExecution] The execution this history event

belongs to.

@param [Hash] options

@option options [Boolean] :#reverse_order (false) When true,

history events are enumerated in reverse chronological order.
# File lib/aws/simple_workflow/history_event_collection.rb, line 35
def initialize workflow_execution, options = {}
  @workflow_execution = workflow_execution
  @reverse_order = options.key?(:reverse_order) ?
    !!options[:reverse_order] : false
  super
end

Public Instance Methods

reverse_order() click to toggle source

@return [WorkflowExecutionCollection] Returns a collection that

enumerates workflow executions in reverse order.
# File lib/aws/simple_workflow/history_event_collection.rb, line 47
def reverse_order
  self.class.new(workflow_execution, :reverse_order => true)
end

Protected Instance Methods

_each_item(next_token, limit, options = {}) { |event| ... } click to toggle source
# File lib/aws/simple_workflow/history_event_collection.rb, line 52
def _each_item next_token, limit, options = {}, &block

  options[:domain] = workflow_execution.domain.name
  options[:execution] = {
    :workflow_id => workflow_execution.workflow_id,
    :run_id => workflow_execution.run_id,
  }
  options[:maximum_page_size] = limit if limit
  options[:next_page_token] = next_token if next_token
  options[:reverse_order] = @reverse_order unless 
    options.has_key?(:reverse_order)

  response = client.get_workflow_execution_history(options)
  response.data['events'].each do |desc|
    event = HistoryEvent.new(workflow_execution, desc)
    yield(event)
  end

  response.data['nextPageToken']

end