relatedAttributes Annotation

relatedAttributes is a Constraint Modeling Language (CML) annotation that resets the domain to the original one for domainComputation.

relatedAttributes annotation specification: Variable

AnnotationrelatedAttributes
Applicable toVariable and Relationship
Value Type/ValuesString
DescriptionFor Variables. If relatedAttributes annotation is not specified, the engine updates the variable domain according to domainComputation and constraint logic. If the relatedAttributes annotation is specified with one or multiple values (separated by comma), the variable domain is reset to the original domain. For relationships. If domainComputation is not explicitly specified, the engine sets it implicitly as true for the relationship. If the domainComputation is specified as true, the relationship domain is dynamically determined based on the configuration and constraint logic. If the domainComputation is specified as false, the relationship domain is fixed.

Example 1 

In this example, the relatedAttributes annotation is not specified for the variables (controlLanguage, controlPlacement, commissioningScope) of the Control type. The domainComputation annotation is defined for the variables. The model contains the constraints.

1type GeneratorSet {
2    relation controls : Control;
3}
4
5type Control {
6    @(domainComputation = true, defaultValue = "English")
7    string controlLanguage = ["English", "Danish", "French"];
8
9    @(domainComputation = true, defaultValue = "Left")
10    string controlPlacement = ["Left", "Right", "Top"];
11
12    @(domainComputation = true, defaultValue = "None")
13    string commissioningScope = ["None", "Remote Support", "On-site Commissioning"];
14
15    constraint(controlPlacement == "Right" -> commissioningScope != "Remote Support");
16
17    constraint(controlLanguage == "Danish" -> commissioningScope != "On-site Commissioning");

Example Description and Configurator Result 

In example 1, the variables of the Control type are not specified with the relatedAttributes annotation, but defined with the domainComputation annotation. As a result, the system updates the variable domain based on the constraint logic.

If the controlPlacement is selected with the “Right” value, the commissioningScope variable domain is updated to exclude the “Remote Support” value;

If the controlLanguage is selected with the “Danish” value, the commissioningScope variable domain is updated to exclude the “On-site Commissioning” value.

Example 2 

In this example, the relatedAttributes annotation is specified for the variable with one value. The domainComputation annotation is defined for the variables. The model contains the constraints.

1type GeneratorSet {
2    relation controls : Control;
3}
4
5type Control {
6    @(domainComputation = true, defaultValue = "English")
7    string controlLanguage = ["English", "Danish", "French"];
8
9    @(domainComputation = true, defaultValue = "Left")
10    string controlPlacement = ["Left", "Right", "Top"];
11
12     @(domainComputation = true, defaultValue = "None", relatedAttributes = "controlPlacement")
13    string commissioningScope = ["None", "Remote Support", "On-site Commissioning"];
14
15    constraint(controlPlacement == "Right" -> commissioningScope != "Remote Support");
16
17    constraint(controlLanguage == "Danish" -> commissioningScope != "On-site Commissioning");
18}

Example 3 

In this example, the relatedAttributes annotation is specified for the variable with one value. The domainComputation annotation is defined for the variables. The model contains the constraints.

1type GeneratorSet {
2    relation controls : Control;
3}
4
5type Control {
6    @(domainComputation = true, defaultValue = "English")
7    string controlLanguage = ["English", "Danish", "French"];
8
9    @(domainComputation = true, defaultValue = "Left")
10    string controlPlacement = ["Left", "Right", "Top"];
11
12    @(domainComputation = true, defaultValue = "None", relatedAttributes = "controlLanguage")
13    string commissioningScope = ["None", "Remote Support", "On-site Commissioning"];
14
15    constraint(controlPlacement == "Right" -> commissioningScope != "Remote Support");
16
17    constraint(controlLanguage == "Danish" -> commissioningScope != "On-site Commissioning");
18}

Example Description and Configurator Result 

In Example 2, the relatedAttributes annotation is defined with the “controlPlacement” value for the commissioningScope variable. As a result, the system controls the domain for the commissioningScope differently depending on controlPlacement or controlLanguage variable selection.

If the controlPlacement is selected with the “Right” value, the commissioningScope variable domain remains unchanged, because the controlPlacement is listed in the relatedAttributes annotation.

If the controlLanguage is selected with the “Danish” value, the commissioningScope variable domain is updated to exclude the “On-site Commissioning” value according to the constraint, because the controlLanguage is not listed in the relatedAttributes annotation.

In example 3, the relatedAttributes annotation is defined with the “controlLanguage” value for the commissioningScope variable. As a result, the system controls the domain for the commissioningScope differently depending on controlPlacement or controlLanguage variable selection.

If the controlPlacement is selected with the “Right” value, the commissioningScope variable domain is updated to exclude the “Remote Support” value according to the constraint, because the controlPlacement is not listed in the relatedAttributes annotation.

If the controlLanguage is selected with the “Danish” value, the commissioningScope variable domain remains unchanged, because the controlLanguage is listed in the relatedAttributes annotation.

Example 4 

In this example, the relatedAttributes annotation is specified for the variable with several values (separated by comma). The domainComputation annotation is defined for the variables. The model contains the constraints.

1type GeneratorSet {
2    relation controls : Control;
3}
4
5type Control {
6    @(domainComputation = true, defaultValue = "English")
7    string controlLanguage = ["English", "Danish", "French"];
8
9    @(domainComputation = true, defaultValue = "Left")
10    string controlPlacement = ["Left", "Right", "Top"];
11
12    @(domainComputation = true, defaultValue = "None", relatedAttributes = "controlPlacement, controlLanguage")
13    string commissioningScope = ["None", "Remote Support", "On-site Commissioning"];
14
15    constraint(controlPlacement == "Right" -> commissioningScope != "Remote Support");
16
17    constraint(controlLanguage == "Danish" -> commissioningScope != "On-site Commissioning");
18}

Example Description and Configurator Result 

In example 4, the relatedAttributes annotation is defined with the “controlPlacement” and “controlLanguage” values for the commissioningScope variable. As a result, the system remains the commissioningScope variable domain unchanged.

If the controlPlacement is selected with the “Right” value, the commissioningScope variable domain remains unchanged, because the controlPlacement is listed in the relatedAttributes annotation.

If the controlLanguage is selected with the “Danish” value, the commissioningScope variable domain remains unchanged, because the controlLanguage is listed in the relatedAttributes annotation.

Example 5 

In this example, the relatedAttributes annotation is not specified for the relationship (temperatureSensors). The domainComputation annotation is defined for the relationship. The model contains the constraints.

1type GeneratorSet {
2    @(defaultValue = "Emergency Standby Power (ESP)")
3    string dutyRating = ["Emergency Standby Power (ESP)", "Prime Power (PRP)", "Continuous Power (COP)", "Data Center Continuous (DCC)"];
4    
5    @(domainComputation = true)
6    relation temperatureSensors : TemperatureSensor[0..1];
7
8    constraint(dutyRating == "Continuous Power (COP)" -> temperatureSensors[BearingTemperatureSensor] == 0);
9
10    constraint(dutyRating == "Data Center Continuous (DCC)" -> temperatureSensors[StatorTemperatureSensor] == 0);
11}
12
13type TemperatureSensor;
14
15type BearingTemperatureSensor : TemperatureSensor;
16
17type StatorTemperatureSensor : TemperatureSensor;

Example Description and Configurator Result 

In example 5, the temperatureSensors relation is not specified with the relatedAttributes annotation, but defined with the domainComputation as true. As a result, the system updates the relationship domain based on the constraint logic.

If the dutyRating is selected with the “Continuous Power (COP)” value, the system re-computes the relationship domain and excludes the BearingTemperatureSensor product to satisfy the constraint. The StatorTemperatureSensor product remains and can be selected in scope of the GeneratorSet bundle product.

If the dutyRating is selected with the “Data Center Continuous (DCC)” value, the system re-computes the relationship domain and excludes the StatorTemperatureSensor product to satisfy the constraint. The BearingTemperatureSensor product remains and can be selected in scope of the GeneratorSet bundle product.

Example 6 

In this example, the relatedAttributes annotation is specified for the relationship (temperatureSensors). The domainComputation annotation is defined for the relationship. The model contains the constraints.

1type GeneratorSet {
2    @(defaultValue = "Emergency Standby Power (ESP)")
3    string dutyRating = ["Emergency Standby Power (ESP)", "Prime Power (PRP)", "Continuous Power (COP)", "Data Center Continuous (DCC)"];
4    
5    @(domainComputation = true, relatedAttributes = 'dutyRating')
6    relation temperatureSensors : TemperatureSensor[0..1];
7
8    constraint(dutyRating == "Continuous Power (COP)" -> temperatureSensors[BearingTemperatureSensor] == 0);
9
10    constraint(dutyRating == "Data Center Continuous (DCC)" -> temperatureSensors[StatorTemperatureSensor] == 0);
11}
12
13type TemperatureSensor;
14
15type BearingTemperatureSensor : TemperatureSensor;
16
17type StatorTemperatureSensor : TemperatureSensor;

Example Description and Configurator Result 

In example 6, the temperatureSensors relation is specified with the relatedAttributes annotation containing the dutyRating value, the domainComputation annotation is defined as true. As a result, the system remains the relationship domain unchanged and executes the constraints.

If the dutyRating is selected with the “Continuous Power (COP)” value, the system displays both BearingTemperatureSensor and StatorTemperatureSensor products in scope of the GeneratorSet bundle product. The BearingTemperatureSensor product cannot be selected based on the constraint.

If the dutyRating is selected with the “Data Center Continuous (DCC)” value, the system displays both BearingTemperatureSensor and StatorTemperatureSensor products in scope of the GeneratorSet bundle product. The StatorTemperatureSensor product cannot be selected based on the constraint.

relatedAttributes Configuration Settings 

Associated ExampleProduct Group StructureApplicable to”relatedAttributes” annotation”domainComputation” annotationUser ActionEngine ActionUI Behavior
Example 1Individual productVariablenot specifiedTRUEChange variable value specified in constraint conditionUpdate the variable (specified with domainComputation) domain based on domainComputation and constraint logicDisplay updated variable domain
Example 2. Example 3.Individual productVariablespecified (with one variable)TRUEChange variable value specified in constraint condition and relatedAttributesReset variable (specified in relatedAttributes) domain to the original domainDisplay original variable domain
Example 4Individual productVariablespecified (with several variables)TRUEChange variable values specified in constraint conditions and relatedAttributesReset variable (specified in relatedAttributes) domain to the original domainDisplay original variable domain
Example 5Individual productRelationshipnot specifiedTRUEChange variable value specified in constraint conditionUpdate the relationship (specified with domainComputation) domain based on domainComputation and constraint logicDisplay updated relationship domain
Example 6Individual productRelationshipspecifiedTRUEChange variable value specified in constraint condition and relatedAttributesReset relationship domain to the original domainDisplay original relationship domain (products). If the product is allowed according to constraint: the product can be selected. If the product is not allowed according to constraint: selected product returns back to unselected state.
N/AProduct ClassificationRelationshipnot specifiedTRUE• Change variable value specified in constraint condition > Add products on browse popup from product classification • Add products on browse popup from product classification > Change variable value specified in constraint condition.Update the relationship (specified with domainComputation) domain based on domainComputation and constraint logicDisplay updated relationship domain. If the variable is changed again by the User, the value is reverted to the initial value
N/AProduct ClassificationRelationshipspecifiedTRUE• Change variable value specified in constraint condition > Add products on browse popup from product classification •Add products on browse popup from product classification > Change variable value specified in constraint condition.• If the variable of constraint condition is changed first: update the relationship (specified with domainComputation) domain based on constraint logic • if products are added first from browse popup: remain the relationship domain unchanged.• If the variable of constraint condition is changed first: display updated relationship domain. If the variable is changed again by the user, the value is reverted to the initial value • if products are added first from browse popup: display added products as selected. If constraint variable is changed again by the user, the value is reverted to the initial value.