Parameters tab

Parameters tab

You can use the Parameters table to avoid using hard-coded string values, such as field names (customer for example).

Another example is in the User Defined Java Class - Calculate the date of Easter.ktr sample transformation, which is in the data-integration/samples/transformations directory. That sample KTR has a parameter called YEAR. The YEAR parameter is referenced with the getParameter()method, as shown in the following example:

getParameter("YEAR")

At runtime, it will return the year String value.

Class Member Variables and the getVariable Function

When getting parameters that point to transformation parameters, the User Defined Java Class step behaves differently depending on when the getVariable function is called. If it is in the init() method, the parameters behave as expected. If the initialization is on a class member variable, the variable is not resolved by design, as shown in the following example:

Last updated

Was this helpful?