Named Parameters

Introduction

Named parameters are a system that allows you to parameterize your transformations and jobs.  On top of the variables system that was already in place prior to the introduction in version 3.2, named parameters offer the setting of a description and a default value.  That allows you in turn to list the required parameters for a job or transformation.

How it works

You can go to the settings dialog of your transformation or job and there you will find the "Parameters" tab...


 
Once these parameters are set they are used at runtime.  If a value is set, that is used.  If no value is set for a parameter, the default is used.

Passing values

Spoon development

The execution dialog of transformations and jobs allow you to set a value for each named parameter that is defined...

At the command line

In both Pan and Kitchen you can list the defined parameters:

user@host:$ sh pan.sh -file:/tmp/foo.ktr -listparam
Parameter: MASTER_HOST=, default=localhost : The master slave server hostname to connect to
Parameter: MASTER_PORT=, default=8080 : The master slave server HTTP control port

You can also define parameters during execution like this:

user@host:$ sh pan.sh -file:/tmp/foo.ktr -param:MASTER_HOST=192.168.1.3 -param:MASTER_PORT=8181

Windows requires you to use quotes around the parameter otherwise the equals sign is treated as a space by the command interpreter:
c:\> pan.sh -file:/tmp/foo.ktr "-param:MASTER_HOST=192.168.1.3" "-param:MASTER_PORT=8181"




In job entries

In both the Job and Transformation job entries in a job you can define how parameters are set and/or passed:

As you can see from the screenshot all parameters defined in the parent job are passed down by default.  You can also selectively pass parameters down by specifying them in the grid.

You can either set the value of a parameter by giving it a value OR by looking up the value in a Result row from a previous transformation.   Simply specify a column name in that case.

In Mapping (execute sub-transformation) Step

You can pass named parameter values to sub-transformations in the 'Parameters' tab of the 'Mapping (execute sub-transformations)' step:
Atention:

As of PDI 4.2.x (?), the named parameter must be defined in the sub-transformation, otherwise the value set here will be ignored.