lib/floe/workflow/states/choice.rb in floe-0.3.1 vs lib/floe/workflow/states/choice.rb in floe-0.4.0
- old
+ new
@@ -14,19 +14,21 @@
@input_path = Path.new(payload.fetch("InputPath", "$"))
@output_path = Path.new(payload.fetch("OutputPath", "$"))
end
- def run!(input)
+ def start(input)
+ super
input = input_path.value(context, input)
next_state = choices.detect { |choice| choice.true?(context, input) }&.next || default
output = output_path.value(context, input)
- [next_state, output]
+ context.next_state = next_state
+ context.output = output
end
- def status
- "running"
+ def running?
+ false
end
def end?
false
end