Skip to content

Constants

Ryan Newington edited this page Sep 4, 2025 · 7 revisions

Constants

ACMA is designed to support using the same configuration file across development, QA and production environments. However, each environment likely has settings that differ between these environments. Constants are stored in the database, meaning they can be used to store environment-specific settings, and can be referenced from the configuration file.

What are Constants?

Constants are a simple mapping between a constant name and a value. To ensure the configuration file stays truly portable between these environments, values can be stored as constants in the database, and referenced from the configuration file.

Usage in ACMA DL

Constants are referenced in ACMA Declarative Language using the %constantName% notation.

Examples

Domain Name Example

A good example would be the name of the Active Directory domain in each environment. A constant adDomain can be created that stores the NetBIOS name of the domain. In the configuration file, wherever the domain is required, it can be referenced using the %adDomain% declaration.

Environment-specific values:

  • Development: %adDomain% = dev-domain
  • Production: %adDomain% = domain

Home Folder Path Example

Another example might be the user's home profile path. In production, users may have a path of \\domain.local\users\accountName, while in the development environment it may be \\dev-domain.local\users\accountName.

Given an attribute called accountName which stores the user name, creating a constant called homeFolderPrefix and setting the value to:

  • Production: \\domain.local\users
  • Development: \\dev-domain.local\users

The config file can simply contain a value declaration of %homeFolderPrefix%\{accountName}. The declaration will always expand to the correct value for that environment.

Common Use Cases

  • Domain names: AD domain names, DNS suffixes
  • Server names: Database servers, file servers
  • Paths: UNC paths, organizational unit paths
  • Email domains: Mail suffixes for different environments
  • Default values: Default passwords, quota limits

Important Notes

  • Constant names must be unique
  • Cannot be the same name as any Built-in variables or Sequences
  • Constants are stored in the database, not the configuration file
  • Values can be modified without changing the configuration file
  • Perfect for environment-specific settings that need to remain consistent across deployments

Clone this wiki locally