I’m in the process of implementing the ability to model exclusion and required constraints in the Attribute Resource. This will allow the following use cases to be modeled:
If a model component has an associated attribute of type A then it can not have an attribute of type B associated to it and vice versa.
In order to a model component to have an attribute of type A associated with it, it must already have an attribute of type B associated with it.
Note that the exclusion constraint is a symmetric relationship - if an attribute of type A excludes an attribute of type B then an attribute of type B must also exclude an attribute of type A.
The required constraint is asymmetric since if A requires B and B requires A you can never associate either.
To support this I’ve added the following Definition methods:
Since the exclusion constraint is symmetric I’m planning on having adef->addExclusionDefinition(bdef) create both adef excludes bdef and bdef excludes adef. Also when an exclusionDefinition is removed it affects both definitions.