Book a Demo

Author Topic: See attributes in search result table  (Read 2524 times)

floerio

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
See attributes in search result table
« on: October 28, 2009, 01:38:42 am »
Hi!

Maybe I've missed a thing: But how can I see in the result table of the search dialog not only classes but the attributes?

I am searching for attributes that have a special stereotype. The search result lists only the classes that contain the attributes, but not the attributes themself.

Is there a way to configure this view?

Cheers,
   Oliver

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: See attributes in search result table
« Reply #1 on: October 28, 2009, 08:57:07 pm »
Oliver,

AFAIK the default searches don't allow this.
You can however write your own sql search that shows attributes and/or operations.
Example:
Code: [Select]
select o.ea_guid as CLASSGUID,'Operation' as CLASSTYPE,o.name as Name,p.Type as 'Type',  class.name as 'Class Name'
,package.name as 'Package Name',package_p1.name as 'Package level -1',package_p2.name as 'Package level -2',package_p3.name as 'Package level -3'
from t_operation as o
join t_operationparams as p on (o.operationID = p.operationID)
join t_object as class on (o.object_id = class.object_id)
join t_package as package on (class.package_id = package.package_id)
left join t_package as package_p1 on (package_p1.package_id = package.parent_id)
left join t_package as package_p2 on (package_p2.package_id = package_p1.parent_id)
left join t_package as package_p3 on (package_p3.package_id = package_p2.parent_id)
where p.type like '<Search Term>'
union
select a.ea_guid as CLASSGUID,'Attribute' as CLASSTYPE,a.name as Name, a.Type as 'Type',  class.name as 'Class Name'
,package.name as 'Package Name' ,package_p1.name as 'Package level -1',package_p2.name as 'Package level -2',package_p3.name as 'Package level -3'
from t_attribute as a
join t_object as class on (a.object_id = class.object_id)
join t_package as package on (class.package_id = package.package_id)
left join t_package as package_p1 on (package_p1.package_id = package.parent_id)
left join t_package as package_p2 on (package_p2.package_id = package_p1.parent_id)
left join t_package as package_p3 on (package_p3.package_id = package_p2.parent_id)
where a.Type like '<Search Term>'

Geert

PS. This example only works on SQL-server. If you want it to work on a local eap file you'll have to adjust the sql to the "MS Access syntax".

floerio

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: See attributes in search result table
« Reply #2 on: October 28, 2009, 09:43:59 pm »
Hi Geert,

thanks for the script!

I did not thought that it was that kind of complex. So I would have to change the script each time my search changes...

Would be nice if the EA guys could add some dynamic to the view itself...

Oliver

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: See attributes in search result table
« Reply #3 on: October 28, 2009, 09:50:47 pm »
Oliver,

The example is complex because that's what I needed.
If you need to be able to search all attributes with a certain stereotype that will be a lot simpler.
I don't know what you mean by rewrite when the search changes, but you'll only need to rewrite if you are searching a different field, not if you are searching for another value.
The <Search Term> text will be replaced by EA with whatever you put in the search field.

Geert