Author Topic: Model Search - error in combining filters?  (Read 1613 times)

Damir

  • EA User
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Model Search - error in combining filters?
« on: April 30, 2008, 04:11:37 pm »
I would like to create a search that finds all elements which have a specific string in one of their stereotypes or in one of the stereotypes of their attributes or methods.
I've read the logic for searches in EA help and it seams that I should create 3 filters in this search, all set to "not required", i.e. they don't have the checkmark on the Required column when viewed in Manage Searches dialog box. Condition for all 3 filters is "Contains", Look For is Search Term. These filters are Element.Stereotype, Element.Attribute.Stereotype, Element.Method.Stereotype.

Now a funny thing happens: If I define only these 3 filters, the result set is basically the whole model, it is not filtered at all. After some time of hacking around I figured out that if I add at least one dummy filter for search on Element features (for example Version), Element.Attribute features (for example Scope) and Element.Method features (for example Alias) (also with Contains Search Term not Required) - it gives correct results.

For testing I created 3 classes: one with the specific steretype of the class, one with that stereotype in an attribute, and the third in a method.

Now, I think this is not correct behaviour. Putting all 3 filters to be required is also not the solution because I want OR relationship between them, not AND relationship. But, again a funny thing happens - if I place only these 3 filters with Required set - then I get the correct results, at least in my case with these 3 classes. I should have gotten nothing because I have no classes with the same stereotype in class, its attribute and a method.

so, is this a bug or I'm doing something wrong?