Annotation Examples
Constraint Modeling Language (CML) annotations are labels that you add to parts of a model, such as types, variables, relationships, and constraints. Annotations control how these elements are shown and how they behave in the configurator. Annotations help fine-tune the configurator and the constraint engine without changing the actual structure of the model.
The examples explain what each annotation does, where it can be used in the model, what kinds of values it supports, and how it behaves when the configurator runs and evaluates constraints. CML code samples show how the annotation works in practice.
-
closeRelation is a CML annotation that controls addition of new line items to the relationship by the engine.
-
configurableis a CML annotation that controls whether a model element can be configured. -
The
defaultValueannotation is used on a variable to define the value it should start with when configuration begins. -
domainComputationis a CML annotation that specifies how the domain of a model element is determined, either by using a fixed domain or by computing the domain dynamically during configuration. -
guardrails is a CML annotation that prevent the constraint engine from changing specified attributes or relations when it resolves the constraint.
-
The
peelableannotation is used to create soft selection values and allow the engine to modify these selections to satisfy a constraint. -
productField is a CML annotation that defines the Product2 field on a variable. productField loads the value from Product Catalog Management (PCM) during constraint model activation.
-
propagateUpis a Constraint Modeling Language (CML) annotation that controls aggregation propagation between children and parent elements. -
relatedAttributesis a Constraint Modeling Language (CML) annotation that resets the domain to the original one for domainComputation. -
The
sequenceannotation defines the execution and configuration order of elements in a Constraint Modeling Language (CML) model. -
splitis a Constraint Modeling Language (CML) annotation that specifies whether the instances of the type should be split or not.