Skip to content

ENH: Adding Exclusion and Required Conditions for Attributes

Attribute Definitions can now provide mechanisms for modeling exclusion and required.

  • Exclusion property: a list of attribute definitions that will prevent attributes, derived from this definition, from being associated to a resource component if the component already has an attribute associated with it that derived from a definition in the exclusion list.

  • Prerequisite property: a list of attribute definitions that will prevent attributes, derived from this definition, from being associated to a resource component unless it also has an attribute asscoiated with it that is derived from a definition in the required list.

  • Added methods for checking association rules, exclusions, and prerequisites

  • Added canBeAssociated method for testing persistent objects

  • Changed the implementation of isUnique. It now used the exclusion mechanism by inserting itself into the list. Note that this rule is not written out when serialized or when saved to a file

  • Updated the qtAssociationWidget to use these new ruled when determining availability

  • Updated the qtAttributeView to test for association rules instead of association masks

  • Added a test for these new constraints

NOTE - the exclusion property should be symmetric (if A doesnt allow B then B shouldn't allow A) but the prerequisite property can not be symmetric (else neither could be associated - if you need to have both attributes always assiged together then the information should be modeled as a single definition)

NOTE - there are issues related to reading in SBI files related the association links.

  • Also made some of the find methods for resources and components const

Merge request reports