guardrails Annotation
guardrails is a CML annotation that prevent the constraint engine from changing specified attributes or relations when it resolves the constraint.
| Annotation | guardrails |
|---|---|
| Applicable to | Constraint |
| Value Type/Values | String. A comma-separated list of the attribute or relation names to protect. |
| Description | Prevents the constraint engine from altering the listed attributes or relations to satisfy the constraint. Defines protections at the constraint level instead of on individual attributes and relations, which avoids conflicts with other constraints that share the same elements. When you guard an attribute, the engine can’t change its domain values or When you guard a relation, the engine can’t change its cardinality. |
In this generator set model, the UL 2200 compliance constraint requires a secondary voltage of 600V or less. The Voltage attribute is guarded, so the engine can’t change its domain values to satisfy the constraint.
In example 1, the guardrails annotation set to “Voltage”. As a result, if the user selects the “Listing-UL 2200” standard, the engine can’t change the domain values of the Voltage attribute to resolve the conflict. Instead, the engine either satisfies the constraint by changing an unguarded element, such as standardsAndCompliance, or displays a conflict error message. Without the guardrails annotation, the engine restricts the domain values of Voltage to satisfy the constraint.