Relationship Annotations

You can annotate relationships by using annotations, such as configurable, allowNewInstance, closeRelation, sourceContextNode, and so on.

You can annotate relationships, as in this example, with configurable=true.

Here are the details of relationship annotations.

AnnotationValuesDescription
allowNewInstancetrue, falseEnables require rule constraints to work on relationships that are otherwise closed. Must be set to true to enable require rule constraints on closed relationships.
closeRelationtrue, falseIf the value is true, prevents the addition of new line items to the relationship. false is the default value and allows the addition of new line items to the relationship. See examples here.
compNumberVartrue, falseAvoids creating a component number variable if it is set to false.
disableCardinalityConstrainttrue, falseDisable cardinality constraint in the relationship to optimize the performance.
domainComputationtrue, falsedomainComputation is a Constraint Modeling Language (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. 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. See examples here.
generictrue, falseIndicates if generic instance is allowed in the relationship or not. Generic instance is used to prompt the user that they need to select a product in the relationship.
noneLeafCardVartrue, falseAvoids creating cardinality variables for none leaf type (a node with no children) in the relationship to optimize the performance.
propagateUptrue, falseAggregates values from child elements to parent elements. If propagateUp is not specified, the engine sets it implicitly as false for the relationship. If the propagateUp annotation is specified as true, the engine aggregates values from children to parent elements (upward propagation). The engine cannot modify this value from the parent level (e.g. via constraint), so the children relation domain will not be affected. If the propagateUp is specified as false, both upward and downward propagations are applicable. The engine aggregates values from children to parent elements (upward propagation). Meanwhile the engine can modify this value (e.g. via constraint) from the parent level. The value is propagated downward and might affect the relation domain (downward propagation). See examples here.
readOnlytrue, falseSets a relationship and all child relationships to read-only, to prevent the engine or user from modifying.
relatedAttributesstring valuerelatedAttributes is a CML annotation that resets the domain to the original one for domainComputation. 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. See examples here.
relatedRelationshipsstring valueRelated relationships whose cardinality variables must be unbound for domain computation.
sequenceintegerIndicates the sequence in which the relationship is configured and executed.
sharingtrue, falseIndicates if the relationship is shared or not. If the relationship is shared, the engine connects the instance from another relationship to this relationship instead of instantiating the instance in the relationship itself.
singletontrue, falseIndicates if all types in the relationship must be singleton or none.
sourcestringData source defined in the model.
sourceAttributeVariable name in stringSets the domain of the current relationship to the domain of the source attribute.
sourceContextNodestringFor cases that use a virtual container, specifies the path in the context service for the instances in the relationship.