Module: AWS::Flow::Utilities::SelfMethods Private

Included in:
AsyncDecider, GenericWorkflowClient
Defined in:
lib/aws/decider/utilities.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#handle_event(event, options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/aws/decider/utilities.rb', line 118

def handle_event(event, options)
  id = options[:id_lambda].call(event) if options[:id_lambda]
  id = event.attributes
  options[:id_methods].each {|method| id = id.send(method)}
  id = options[:id_methods].reduce(event.attributes, :send)
  id = @decision_helper.send(options[:decision_helper_id])[id] if options[:decision_helper_id]
  state_machine = @decision_helper[id]
  state_machine.consume(options[:consume_symbol])
  if options[:decision_helper_scheduled]
    if state_machine.done?
      scheduled_array = options[:decision_helper_scheduled]
      open_request = @decision_helper.send(scheduled_array).delete(id)
    else
      scheduled_array = options[:decision_helper_scheduled]
      open_request = @decision_helper.send(scheduled_array)[id]
    end
    if options[:handle_open_request]
      options[:handle_open_request].call(event, open_request)
    end
  end
  return state_machine.done?
end