Working with Variables | ||
---|---|---|
Previous | Next | |
Working with Processes | Going to Production |
Variables can be created as metadata with the “Variable Set” metadata type.
To create a new Variable set :
To create a new Variable :
Name | Mandatory | Description |
---|---|---|
Name | yes | Name of the Variable |
Type | Type of the Variable : String, Integer, Boolean or Float. The default value will be String. | |
Refresh Query | Used if a Refresh Connection is defined. This query will be executed to retrieve a value for the Variable. In case of a query returning multiple rows or multiple columns (or both), the first column of the first row will used as the value | |
Default Value | The default value of the Variable | |
Saving Connection | Connection used to save the values of the Variable. A connection should be defined first. See below for more information. | |
Refresh Connection | Connection used by the Refresh Query. A connection should be defined first. See below for more information. | |
Default Operation | Operation used when invoking the Variable Manager. |
Connections can be defined and shared in the Variable Set.
This will allow:
To define a connection :
Note: You can add several connections in the Variable Set.
Tip: You can use different types of metadata nodes in the connection : a server, a schema, a table or even a column. This can be useful to generate the proper SQL command for the refresh query.
Once the connections are defined in the variable set, they can be used to refresh or save the values of the variables.
The Refresh and the save connections can be defined for each variable in the properties tab in its own combo box.
The Refresh and the save connections can also be defined on the Set node. In this case, all the variables for which connections are not defined will use these connections.
The node that has been defined on the connection can be used to generate the SQL orders.
The node, in fact, is a link to the Metadata.
In the Refresh Query, you can use the Xpath or metadata functions provided by Semarchy Convergence for DI directly inside the { } enclosers.
If the metadata used in the connection is a schema, you can use the following syntaxes :
{ ./tech:physicalName() }
{ ./md:objectPath(.,'MYTABLE') }
If the metadata used in the connection is a table, you can use the following syntax :
{ ./tech:physicalPath() }
To use a Variable in a Mapping :
In the Expression Editor the Variable will automatically have the following syntax :
%{VARIABLE_NAME}%
where VARIABLE_NAME is the name of the variable.
To use a variable in a mapping :
Tip: if you want get a value in a table to parameter a mapping, you can instantiate a variable in a process as explained below. Or if the variable has a refresh query, it will be used to get the value. You can then use the variable in the mapping as explained in the previous sections.
In order to use a variable in an expression (action text or parameter), you will have to instanciate the variable in the process, and use the following syntax :
%{VARIABLE_NAME}%
where VARIABLE_NAME is the name of the variable.
In order to use a variable in another variable, there are two cases :
The two variables are defined in the same metadata file
In this case, you will just have to use the following syntax :
%{VARIABLE_NAME}%
where VARIABLE_NAME is the name of the variable.
This syntax can be used in the query or in the default value.
The two variables are defined in different metadata files
In this case, before using the variable inside another variable, you will have to link the two metadata files together :
%{VARIABLE_NAME}%
where VARIABLE_NAME is the name of the variable.
This syntax can be used in the query or in the default value.
In order to use a variable in other metadata properties (ie. a variable in a table condition), you will have to link the two metadata files together :
%{VARIABLE_NAME}%
where VARIABLE_NAME is the name of the variable.
Previous | Top | Next |
Working with Processes | Going to Production |