A property is a named constant holding information to be supplied later. Properties let you use logical names instead of some constants, which improves flexibility and portability of the graphs. You access the value of property by its name closed into ${}, for example ${parametr_name}.
Property definitions can be nested - i.e. definition of one property can reference other property's value.
The property file defines set of properties that are used in graphs. An example below shows how to define path to workspace. Properties are stored for example in workspace.prm file.
Note: For characters that are impossible to enter directly, there are several escape sequences: \\, \n, \t, \r, \”, \f, \b. So be careful when using “\” character, eg. parameter file=c:\temp will be interpreted as “c: temp” while “\t” is interpreted as tabulator; to get “c:\temp” write file=c:\\temp.
File definition:
# WORKSPACE = c:\\cloverETL\\examples WORKSPACE = /home/cloverETL/examples
Xml definition and usage:
<?xml version="1.0" encoding="UTF-8"?> <Graph> <Global> ... <Property fileURL="workspace.prm" id="GraphParameter0"/> <Property id="GraphParameter1" name="outputData" value="output/customers.sorted"/> <Property id="GraphParameter2" name="sortKey" value="CUSTOMERID"/> <Property id="GraphParameter3" name="metadata" value="metadata/delimited/customers.fmt"/> <Property id="GraphParameter4" name="inputdata" value="data/delimited/customers_delimited.txt"/> <Property id="GraphParameter5" name="date" value="20070308"/> </Global> <Phase number="0"> <Node id="INPUT1" type="DELIMITED_DATA_READER" fileURL="${WORKSPACE}/${inputdata}"/> <Node id="OUTPUT" type="DELIMITED_DATA_WRITER" fileURL="${WORKSPACE}/${outputData}"/> <Node id="SORT" type="SORT" sortKey="${sortKey}"/> <Node dbConnection="DBConnection0" enabled="disabled" id="DB_INPUT_TABLE0" sqlQuery="select * from some_table where date_format(valid_from,'%Y%m%d') = '${date}'" type="DB_INPUT_TABLE"/> <Edge id="INEDGE1" fromNode="INPUT1:0" toNode="SORT:0" inPort="0 (SORT)" metadata="InMetadata" outPort="0 (INPUT1)"/> <Edge id="OUTEDGE" fromNode="SORT:0" toNode="OUTPUT:0" inPort="0 (OUTPUT)" metadata="InMetadata" outPort="0 (SORT)"/> </Phase> </Graph>
Defining property on command line
Clover's runGraph command has -P option with following semantics: -P:<key>=<value>. It allows you to define value of particular property (<key>) which
may be later referenced inside transformation graph. For more runGraph's parameters, see running.
Defining property in CloverETL Designer
Parameters category in the Outline pane and select Parameters → Create internal parameters from the context menu. In the wizard that will open, use the Plus button to define names and values of internal parameters (properties).Run Configurations… wizard, and those defined from the command line. They have higher priority than the environment variables. They can overwrite all environment variables and they can be overwritten by the external parameters, the parameters defined in the Run Configurations… wizard, and those defined from the command line.File → New → Other… from the main menu. In the wizard that will open, select Graph parameter file and click Next. Again, use the Plus button to define names and values of parameters (properties) that will be external (shared) now. Click Next and select the project into which the parameters file (choose its name) should be saved. Then click OK. This file (defining external parameters) should be subsequently linked to a graph by selecting Parameters → Link parameter file from the context menu. Run Configurations… wizard and those defined from the command line. They have higher priority than both the internal paremeters and the environment variables. They can overwrite all internal parameters and environment variables and they can be overwritten by the parameters defined in the Run Configurations… wizard, and those defined from the command line.
Defining property in the Run Configurations (Open Run Dialog) wizard
You can also define parameters in this wizard. You can define them either in its Main tab or Arguments tab. And in either of these two tabs, you can define individual parameters either by specifying a sequence of the individual expressions (-P:<parameterN>=<valueN>) separated by white space, or specifying the path and the name of an external file where each row defines one parameter in the following form: parameterN=valueN.
Thus, you can have: -P:paremeter1=value1 -P:parameter2=value2 … -P:parameterN=valueN or a file consisting of the rows:
parameter1=value1 ... parameterN=valueN
Run → Run Configurations (or Run → Open Run Dialog, in older versions of Eclipse). Then, in its Arguments tab, type a sequence of parameters in its Program arguments textarea or type -cfg <filename> at the same place, where the <filename> will be the name and the path of the file with your parameters definition.Run → Run Configurations (or Run → Open Run Dialog, in older versions of Eclipse). Then, in its Main tab, type a sequence of parameters in its Parameter file textarea or type <filename> at the same place, where the <filename> will be the name and the path of the file with your parameters definition. They correspond to the parameters specified from the command line.
Special parameter