Module: Trailblazer::Activity::TaskWrap::VariableMapping

Defined in:
lib/trailblazer/activity/task_wrap/variable_mapping.rb

Overview

Creates taskWrap steps to map variables before and after the actual step. We hook into the Normalizer, process ‘:input` and `:output` directives and translate them into a DSL::Extension.

Note that the two options are not the only way to create filters, you can use the more low-level Scoped() etc., too, and write your own filter logic.

Class Method Summary collapse

Class Method Details

.normalizer_step_for_input_output(ctx) ⇒ Object

DSL step for Magnetic::Normalizer. Translates ‘:input` and `:output` into VariableMapping taskWrap extensions.



14
15
16
17
18
19
20
21
# File 'lib/trailblazer/activity/task_wrap/variable_mapping.rb', line 14

def self.normalizer_step_for_input_output(ctx, *)
  options, io_config = Magnetic::Options.normalize( ctx[:options], [:input, :output] )

  return if io_config.empty?

  ctx[:options] = options # without :input and :output
  ctx[:options] = options.merge(Trailblazer::Activity::TaskWrap::VariableMapping(io_config) => true)
end