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
-
.extension_for(input, output) ⇒ Object
The taskWrap extension that’s included into the static taskWrap for a task.
-
.normalizer_step_for_input_output(ctx) ⇒ Object
DSL step for Magnetic::Normalizer.
Class Method Details
.extension_for(input, output) ⇒ Object
The taskWrap extension that’s included into the static taskWrap for a task.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/trailblazer/activity/task_wrap/variable_mapping.rb', line 24 def self.extension_for(input, output) Trailblazer::Activity::DSL::Extension.new( Merge.new( Module.new do extend Path::Plan() task input, id: "task_wrap.input", before: "task_wrap.call_task" task output, id: "task_wrap.output", before: "End.success", group: :end end ) ) end |
.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, *) , io_config = Magnetic::Options.normalize( ctx[:options], [:input, :output] ) return if io_config.empty? ctx[:options] = # without :input and :output ctx[:options] = .merge(Trailblazer::Activity::TaskWrap::VariableMapping(io_config) => true) end |