TimeXtender support multiple environments, aligning with the ideals of CI/CD and Agile development. Along with these environments, developers need to apply business logic to only one of the environments. Using Project Variables is a great way to programatically apply this custom business logic, for a variety of purposes.
System Project Variables allow you to use system names as project variables, to be leveraged in your SQL code, Execution Packages, and Project Perspectives. This is yet another way that TimeXtender makes it easy to develop complex data solutions without leaving the TX platform.
System project variables include:
- Machine Name
- Environment Name
- User Name
- User Domain Name
Example Use Case - System Variable: Environment Name
If we wanted to apply a project variable in the Development environment programmatically, we can use a system variable (i.e. Environment Name). After creating the System project variable, we can apply this system project variable with a custom condition and a fixed value to the Development environment. For example, maybe you would like an Execution Package to only run in your Development environment but not your Test or Production environments.
In order to use the Environment Specific project variable, you'll need to have at least one environment created in TimeXtender. To learn more about environments in TimeXtender and get help setting up, please see Configure Multiple Environments or contact your TimeXtender Partner or Solution Specialist.
How to create an Environment Specific project variable
- In TimeXtender, select Project Variables under the Tools menu in the toolbar.
- Select Add to create the new project variable.
- Provide a Name for your new project variable.
- Select System in the Type drop-down.
- Select Environment Name in the Value drop-down menu.
- Click OK.
How use an Environment Specific project variable with an Execution Package
- To begin, open the Execution object in the Solution Explorer, by double clicking the name.
- Right-click the execution package to apply the project variable, and select Add Usage Condition. The right side of your screen will show Project Variables, including the one you've just created.
- Select your Environment Specific project variable from the list.
- The defaults for Operator and Comparer don't require a change, but you'll enter the exact name of the Environment in the Value field.
- Click Add.