Project variables

Project variables serve to customize the behavior of your transformation project. In the project settings you can define variables that can be used in parameters for transformation functions or scripts. Variables defined there will be saved with the project, but can also be overridden by setting specific environment variables or providing Java system properties.

Define variables

Go to WindowSettings and then to ProjectVariables to define project variables from within halestudio. Any variable you add here is stored in the project when you next save it.

Overriding variable values

When looking up a project variable, hale first looks for a corresponding Java system property with the prefix hale.project. this means to override the variable with the name NAME , you can specify a system property named hale.project.NAME .

If no system property is found, hale looks for a corresponding environment variable. In that case the expected prefix is HALE_PROJECT_ . Thus to override the variable with the name NAME , you can specify an environment variable named HALE_PROJECT_NAME .

The variable value stored in the project is used when neither a system property nor an environment variable are defined. If the variable is also not defined in the project, it is not resolved.

Using variables in transformation functions

Most transformation functions support variable replacement in their parameters. If you want to have a variable value inserted into a parameter, specify it with the following notation:

{{project:<variable name>}}

See the image below for an example using a variable in the Assign function:

Specific support for using project variables is also provided in Groovy script based functions. Please take a look at the respective function documentation on how to use project variables there.