class AWS::Flow::Replayer::WorkflowReplayer
An AWS
Flow
Framework utility used to replay a workflow history in the decider against the workflow implementation. Primarily used for debugging workflows.
## Usage
**Create an instance of the replayer with the required options:**
~~~~ replayer = AWS::Flow::Replayer::WorkflowReplayer.new
(
domain: '<domain_name>', execution: { workflow_id: "<workflow_id", run_id: "<run_id>" }, workflow_class: WorkflowClass
) ~~~~
**Call the replay method (optionally) with the replay_upto event_id number**
~~~~ decision = replayer.replay(20) ~~~~
Attributes
task_handler[R]
task_provider[R]
Public Class Methods
new(options)
click to toggle source
Initialize a new WorkflowReplayer.
@param options A hash of options. The hash must contain at least
`:workflow_class`.
@raise |ArgumentError| if no options hash was passed in, or if the
options are missing the `:workflow_class` key.
# File lib/aws/replayer.rb, line 218 def initialize(options) raise ArgumentError.new("You must pass in an options hash") if options.nil? raise ArgumentError.new("options hash must contain :workflow_class") if options[:workflow_class].nil? # Create the service decision task helper to fetch and truncate the # history @task_provider = ServiceDecisionTaskProvider.new(options) @task_handler = DecisionTaskHandler.from_workflow_class(options[:workflow_class]) end
Public Instance Methods
replay(replay_upto = nil)
click to toggle source
Performs a replay of workflow history.
@param replay_upto [Fixnum] Optional. If set, replays the history
only until the specified event is reached. If not set, then all history will be returned.
# File lib/aws/replayer.rb, line 234 def replay(replay_upto = nil) task = @task_provider.get_decision_task(replay_upto) @task_handler.handle_decision_task(task) unless task.nil? end