Description of problem: According to https://docs.jboss.org/author/display/RHQ/Group+Definitions - expressions should not create empty groups but they do on 4.9.0-SNAPSHOT Build Number: 067cb8c Version-Release number of selected component (if applicable): Version: 4.9.0-SNAPSHOT Build Number: 067cb8c How reproducible: Always Steps to Reproduce: 1. create a new dynagroup definition with following expression: 'resource.type.name = nonExistingTypeName' 2. click on Save&Recalculate Actual results: Empty dynagroup is created. Expected results: Expressions will not create empty groups Additional info: The same behaviour for following expressions: - memberOf = nonExistingGroup - memberOf = emptyGroup
I would fix the documentation rather than the actual implementation. Sometimes it can be useful to have an empty managed group, take for instance dynagroup definition for all resources that are down "resource.availability = DOWN". One can have an CLI script checking the size of the resulting group, but if the group doesn't exist it is more difficult for him to do the same. I haven't looked to the code, but I can imagine the id for group is reassigned over and over again if the resulting group is empty => non-existent and subsequently non-empty => has to be created again. To me it is more confusing to have multiple groups appearing and disappearing in the groups inventory than to have few empty groups that actually indicate some state of the system (there are no such resources that fulfill the condition).