lib/floe/workflow/states/choice.rb in floe-0.2.1 vs lib/floe/workflow/states/choice.rb in floe-0.2.2
- old
+ new
@@ -14,18 +14,15 @@
@input_path = Path.new(payload.fetch("InputPath", "$"))
@output_path = Path.new(payload.fetch("OutputPath", "$"))
end
- def run!(*)
- super do |input|
- next_state_name = choices.detect { |choice| choice.true?(context, input) }&.next || default
- next_state = workflow.states_by_name[next_state_name]
+ def run!(input)
+ input = input_path.value(context, input)
+ next_state = choices.detect { |choice| choice.true?(context, input) }&.next || default
+ output = output_path.value(context, input)
- output = input
-
- [output, next_state]
- end
+ [next_state, output]
end
end
end
end
end