Skip to content
  • Robert M. O'Bara's avatar
    ENH: Adding Exclusion and Required Conditions for Attributes · e295de91
    Robert M. O'Bara authored
    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
    - Attribute's disassociate method now is allowed to fail (and return the attribute using it as a prerequisite.  Also added a test method
    - Did the same thing for Attribute's removeAllAssociations() method.  Added a parameter to indicate if it should remove the associations it can or should it not remove any if it can't remove all.
    - Updated the qtAssociationWidget to use these new ruled when determining availability
    - Updated the qtAttributeView to test for association rules instead of association masks
    - Fixed bug in AttributeView that would display attributes multiple times based on it being derived from an non-abstract Definition type
    - Changed Attribute View to show a warning when it can not remove an attribute due to it being used to satisfy prerequisites
    - 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
    e295de91