Variable Domains and Domain Restrictions
A variable can have a fixed domain that defines a set of permitted values. You can specify the domain as a list of discrete values, a continuous range, or a combination.
A variable can have a fixed domain that defines a set of permitted values. You can specify the domain as:
- A list of discrete values
- A continuous range
- A combination of ranges and discrete values
For more information, see domainComputation in Variable Annotations.
This example defines a SwitchgearBay type with three variables, each having a fixed domain.
BayTypecan be one of the specified string values.Bay_Numbercan be any integer from 1 through 9 (inclusive).Total_Power_Required_kWcan be any integer from 1 through 100000 (inclusive).
For string (picklist) variables, if you don’t specify a defaultValue annotation and don’t define a default in the Product Attribute Definition in Product Catalog Management (PCM), the configurator uses the first value in the domain as the initial value. In the example, BayType defaults to "load". To set a different default, use the defaultValue annotation on the variable. To avoid inconsistent behavior at run time, use the same default value in CML as the default value you define in PCM.