Parameters with CTL Expressions (Dynamic Parameters)
Since of CloverETL 4.0.0-M2,
you can also use CTL2 expression in parameters.
The CTL2 expression has to return a string
data type.
Example 36.2. Dynamic graph parameters - usage of CTL2 as a graph parameter value
//#CTL2 function string getValue() { return date2str(today(), "YYYY-MM-dd HH:mm:ss"); }
To assign CTL2 code to a graph parameter, use the Edit Parameter CTL2 Value dialog.
Time of Evaluation
If you design long-running graph, you may need to know, when dynamic parameters are evaluated.
Exact point of evaluation of graph parameter depends on way of an access to the parameter.
If you access the parameter using getParamValue()
,
dynamic parameters are evaluated each time the getParamValue()
function is called.
You can use this approach e.g. to make a timestamp of particular record processing.
If you access a parameter value using ${PARAMETER_NAME}
,
the parameter value is evaluated once during initialization.
Note that the parameter can be initialized in different places on different time.