Working with Constants
Constants function as global variables that can be used in any deployment and in any environment. There are two types of constants:
-
Changeable Constants: Users can create, edit, and delete changeable constants as necessary.
-
Fixed Constants: These constants are automatically generated based on the information provided for each deployment. For example,
DPM-TEST_MODULE
would correspond to the module name of a deployment nameddpm
that is used in atest
environment. Fixed constants cannot be modified or deleted.
You can view available constants on the Constants overview screen.
For each constant, you can see the following:
-
Name: The name of the constant, which is used to refer to the constant from a configuration property.
-
Value: The value of the constant.
-
State: There are two states, USED and DELETED. States are currently used only for visual distinction. Deleted constants can no longer be edited.
When defining a property, use this syntax to refer to a constant:
ataccama.one.property-name={{constantName}}
Constants cannot be used as part of a value. In other words, they can only be used to completely substitute the value, for example:
|
Add constants
To create a new constant, follow these steps:
-
In the Configuration Service, go to the Constants tab.
-
Select Create.
-
Provide the following information:
-
Name: The name of the constant. Required.
-
Value: The constant value. You can specify the value later when editing the constant.
-
-
Save the changes.
Edit constants
You can update the value of any changeable constant as needed. If you need to change the name of a constant, create a new constant instead.
-
In the Configuration Service, go to the Constants tab.
-
Select the constant that you want to edit.
-
In the dialog that appears, specify the new value.
-
Save the changes.
Updating a constant sets the status of all deployments where the constant is referenced to
DRAFT
. Therefore, you need to redeploy the properties in all such deployments to make sure that they are using the latest version of the configuration.This applies to both changeable and fixed constants.
Delete constants
You can only remove changeable constants.
The deleted constant can still be viewed in the Constants overview, but it can no longer be edited and its state is updated to DELETED
.
-
In the Configuration Service, go to the Constants tab.
-
Find the constant that you want to delete and select more options.
-
Select the Delete option.
-
In the confirmation dialog that appears, click Delete to confirm your choice.
The state of the constant has been updated to Deleted and it can no longer be used.
Was this page useful?