Module: Floe::Workflow::States::InputOutputMixin

Included in:
Map, Parallel, Pass, Task
Defined in:
lib/floe/workflow/states/input_output_mixin.rb

Instance Method Summary collapse

Instance Method Details

#process_input(context) ⇒ Object



7
8
9
10
11
# File 'lib/floe/workflow/states/input_output_mixin.rb', line 7

def process_input(context)
  input = input_path.value(context, context.input)
  input = parameters.value(context, input) if parameters
  input
end

#process_output(context, results) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/floe/workflow/states/input_output_mixin.rb', line 13

def process_output(context, results)
  return context.input.dup if results.nil?
  return if output_path.nil?

  results = result_selector.value(context, results) if @result_selector
  if result_path.payload.start_with?("$.Credentials")
    credentials = result_path.set(context.credentials, results)["Credentials"]
    context.credentials.merge!(credentials)
    output = context.input.dup
  else
    output = result_path.set(context.input.dup, results)
  end

  output_path.value(context, output)
end