Using defines to override
- Last UpdatedDec 06, 2023
- 1 minute read
The defines work as constants inside scripts and can be used to populate fields or for pre-processing. Defines and configuration files are closely connected.
-
Most defines are embedded inside the application modules that are included inside PAK files and not exposed to the developer.
-
The configuration files (such as config.xml, cfg_commons.xml, cfg_simulation.xml) offer a way to customize the behavior of these modules from outside and overrides the defines declaration.
-
For each property exposed in a config file, a corresponding define is embedded inside a module script. The define name must match the complete property name.
-
When the application starts, the defines value is overridden with what is set into the corresponding configuration file. This enables you to customize the application behavior.
Code example
A code example that contains a define.
<!-- cfg property structure -->
<config version="1.0">
<struct name="simsetup">
<struct name="login">
<item name="type" type="sstring" value="password" description="login type" constraints="combo:anonymous,badge,password" />
<!--...-->
</struct>
<!--...-->
</struct>
<!--...-->
</config>
<!-- corresponding define -->
<define name="simsetup.login.type" value="password" />