Variables and parameters can be referenced with different syntaxes, depending on the context, when you want the substitution to be done, and what you want to do.
This article shows an overview of the available syntaxes with examples and explanations.
Overview
Syntax |
Substituted_at |
Description |
${<parameterPath>}$ |
Execution | References process parameters or session variables |
:{<columnName>}: |
Execution | References the result of a bind |
%{<variableName>}% |
Execution | References metadata variables |
%x{<xPathExpression>}x% |
Build | Generates code or properties from metadata information |
%e(<language>){<script>}e(<language>)% |
Execution | Executes a script in the specified scripting language |
%b(<language>){<script>}b(<language>)% | Execution | Executes a script in the specified scripting language with the result of a bind |
Details and Examples
${<parameterPath>}$
Substituted : At Execution
This syntax is used to retrieve process parameters or session variables.
The path to the parameter must be set accordingly to the context of its use. The '~
' represents the root of the process.
Examples :
:{<columnName>}:
Substituted : At Execution
This syntax is used to retrieve the result of a bind.
See this article for an example with SQL Operation Action.
%{<variableName}%
Substituted : At Execution
This syntax is used to retrieve a metadata variable, through Variable Manager, or metadata link.
Don't forget to drag and drop the variable in the process/mapping/metadata... in which you want to use it.
Examples :
In a process
In a metadata
%x{<xPathExpression>}x%
Substituated : At Build (delivery generation)
This syntax permits to use xPath expressions to retrieve metadata information.
We cannot list all available xpath expressions, because it depends on the technology and the element on which you want to retrieve information.
To see the available Xpath expressions for an element :
Right click > XPath
or
Right click > Global XPath
Clicking on an expression will show you its output in the console.
To use an xpath expression on a process action for example, drag and drop the metadata element on the action, and use :
%x{$Name_Of_Metadata_Link/<xpathExpression>}x%
Example :
Note: you can drag and drop the metadata on the process instead of the action.
%e(<language>){<script>}e(<language>)%
This is used to execute a script in the language defined.
Supported languages :
- rhino (javascript)
- Groovy
- Jython
The Runtime API "__ctx__", provided by Stambia can be used in all languages.
See the Designer's help for further information.
Example :
%b(<language>){<script>}b(<language>)%
This is used to execute a script in the language defined and use the result of a bind (when the script is being executed on an action that is the target of a bind link).
Example :