Parameters with CTL Expressions (Dynamic parameters)

Since the version 4-0-0-M2 of CloverETL you can also use CTL2 expression in parameters. The CTL2 expression has to return 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 you use Edit Parameter CTL2 Value dialog.

[Note]Note

Earlier versions of CloverETL than 4-0-0-M2 employed a today deprecated CTL1 expressions to assign a dynamic value to graph parameters:

Since the version 2.8.0 of CloverETL, you could use CTL expressions in parameters and other places of CloverETL. Such CTL expressions can use any possibilities of CTL language. However, these CTL expressions had to be surrounded by back quotes.

For example, if you defined a parameter TODAY="`today()`" and used it in your CTL codes, such ${TODAY} expression would be resolved to the current day.

If you want to display a back quote as is, you must use this back quote preceded by back slash as follows: \`.

The usage of CTL1 is now deprecated!

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 of getParamValue() function call. You can use this approach e.g. to make a timestamp of particular record processing.

If you access parameter value using ${PARAMETER_NAME}, the parameter value is evalueated once during initialization. Note, that the parameter can be initialized in different places on different time.