Skip to main content
Pentaho Documentation

Reusing Transformation Flows with Mapping Steps

 

Overview

Explains how to reuse repeated steps.

When you want to reuse a specific sequence of steps, you can turn the repetitive part into a mapping. A mapping is a standard transformation except that you can define mapping input and output steps as placeholders.

  • Mapping Input Specification — the placeholder used for input from the parent transformation
  • Mapping Output Specification — the placeholder from which the parent transformation reads data

Pentaho Data Integration samples that demonstrate the use of mapping steps are located at ...samples\mapping\Mapping.

Below is the reference for the Mapping (sub-transformation) step:

Option Description
Step name Optionally, you can change the name of this step to fit your needs.
Mapping transformation Specify the name of the mapping transformation file to execute at runtime. You can specify either a filename (XML/.ktr) or a transformation from the repository. The Edit button opens the specified transformation under a separate step in the Spoon Designer.
Parameters Options under the Parameters tab allow you to define or pass PDI variables down to the mapping. This provides you with a high degree of customization.

It is possible to include variable expressions in the string values for the variable names.

Important! Only those variables/values that are specified are passed down to the sub-transformation.

Input Tabs Each of the Input tabs (may be missing) correspond to one Mapping Input Specification step in the mapping or sub-transformation. This means you can have multiple Input tabs in a single Mapping step. To add an Input tab, click Add Input.
  • Input source step name— The name of the step in the parent transformation (not the mapping) from which to read
  • Mapping target step name — The name of the step in the mapping (sub-transformation) to send the rows of data from the input source step
  • Is this the main data path? — Enable if you only have one input mapping ; you can leave the Mapping source step name and Output target step name fields blank
  • Ask these values to be renamed back on output? — Fields get renamed before they are transferred to the mapping transformation

    Enabling this option renames the values back to their original names once they move to the Mapping output step. This option makes your sub-transformations more transparent and reusable.

  • Step mapping description — Add a description of the mapping step
  • Source - mapping transformation mapping Enter the required field name changes
Output Tabs Each of the Output tabs (may be missing) correspond to one Mapping Output Specification step in the mapping or sub-transformation. This means you can have multiple Output tabs in a single Mapping step. To add an Output tab, click Add Output.
  • Mapping source step — the name of the step in the mapping transformation (sub-transformation) where that will be read
  • Output target step name — the name of the step in the current transformation (parent) to send the data from the mapping transformation step to.
  • Is this the main data path? — Enable if you only have one output mapping and you can leave the Mapping source step and Output target step name fields above blank.
  • Step mapping description — Add a description to the output step mapping
  • Mapping transformation - target step field mapping — Enter the required field name changes
Add input / Add output Add an input or output mapping for the specified sub-transformation