You can configure an expression parameter type. An expression parameter is a parameter that contains a complete expression.
You can use an expression parameter in the following transformation fields:
Aggregator. Port expression.
Expression. Port expression.
Filter. Filter condition.
Join. Join condition.
Lookup. Lookup condition.
Rank. Port expression.
If you configure an expression parameter in a filter, join, or lookup condition in a Filter, Join, or Lookup transformation, the expression parameter must evaluate to TRUE or FALSE.
If you configure an expression parameter in the port expression for an Aggregator, Expression, or Rank transformation, the port must contain only the expression parameter. The result value of the parameter must match the port data type. For example, if the port data type is a string, the expression must evaluate to a string.
Define the expression parameter in the Expression Editor. Select
Specify by Parameter
to indicate that the complete expression is parameterized.
For example, the following image shows the
Specify by Parameter
option for the filter condition:
When you use an expression parameter, you can create the expression parameter or you can select an existing expression parameter to use in the transformation. An expression parameter can contain ports, operators, and constants. For example, you might create expression parameters with different port names and operators in a dynamic mapping. The expression parameter cannot contain other parameters.
If the expression parameter is a transformation parameter, you can bind the transformation parameter to a mapping parameter. You can override the mapping parameter at run time.
Restrictions for Port Expressions
If you use expression parameters for port expressions, consider the following restrictions:
If you create the expression parameter as a mapping parameter, you cannot validate the default value of the parameter unless the parameter is used as a port expression in a transformation.
The mapping fails if the default value of the expression parameter is not valid.
The mapping fails if the return value of the expression parameter does not match the data type of the port.