Author Topic: Search for diagram with name  (Read 8466 times)

Martin S.

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Search for diagram with name
« on: March 20, 2013, 09:32:53 pm »
Hello,

is it possible to include diagrams into the search results (CTRL + F)?

When I search for a string I want also that diagrams are listed in the search results which include that string in their diagram name.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13251
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search for diagram with name
« Reply #1 on: March 20, 2013, 09:39:15 pm »
I use an sql search to search for diagrams
Code: [Select]
select d.ea_guid as CLASSGUID,d.Diagram_Type as CLASSTYPE,d.name as Name ,package.name as PackageName
,package_p1.name as PackageLevel1,package_p2.name as PackageLevel2 ,package_p3.name as PackageLevel3
from ((((t_diagram d
inner join t_package package on d.package_id = package.package_id)
left join t_package package_p1 on package_p1.package_id = package.parent_id)
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id)
where d.name like '#WC#<Search Term>#WC#'

Geert

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Search for diagram with name
« Reply #2 on: March 20, 2013, 09:44:15 pm »
Unfortunately you can't add the diagram search type to any other filter types.

But you can add an additional search for your required string
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Search for diagram with name
« Reply #3 on: March 20, 2013, 11:14:43 pm »
Extending on that last remark, the next best thing would be the custom search below that extends 'Simple' with the -parent- of matching diagrams.

Matching diagrams are identified by a 'Note' symbol in the search result, and ALT+G on the result will navigate the project browser to the parent of the diagram.

best regards,

Paulus

Code: [Select]
select ea_guid AS CLASSGUID,
Object_Type AS CLASSTYPE,
Name
FROM t_object
where t_object.alias like '#WC#<Search Term>#WC#'
 or t_object.name like '#WC#<Search Term>#WC#'

 UNION

select t_object.ea_guid AS CLASSGUID,
"Note" AS CLASSTYPE,
t_diagram.Name
FROM t_diagram
      , t_object
where t_diagram.name like '#WC#<Search Term>#WC#'
      and t_diagram.parentid = t_object.object_id

UNION

select t_package.ea_guid AS CLASSGUID,
"Note" AS CLASSTYPE,
t_diagram.Name
FROM t_diagram
      , t_package
where t_diagram.name like '#WC#<Search Term>#WC#'
      and (t_diagram.parentid = 0
      and t_diagram.Package_ID = t_package.Package_ID)

Martin S.

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Search for diagram with name
« Reply #4 on: April 04, 2013, 03:00:09 am »
Thanks for your replies so far! I'm new to Enterprise Architect so I have no clue what to do with the code snippets. Can you give me a link to a page which shows what I'm supposed to do with these snippets?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13251
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

Patrick Julian

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Search for diagram with name
« Reply #6 on: April 04, 2013, 03:59:46 am »
Wow. That is really a core functionality of a modeling tool missing in EA.

stevesavage

  • EA User
  • **
  • Posts: 119
  • Karma: +4/-0
    • View Profile
Re: Search for diagram with name
« Reply #7 on: September 15, 2013, 01:01:00 am »
I've been looking at this, more to filter out certain diagrams types from specific reports (that's why I don't want to use the feature to exclude a diagram from ALL reports)

What I find odd: the help section on Filters in EA 10 specifically shows and mentions filtering by Diagram properties:

"If you are adding filters to an existing search, the list contains only items appropriate to the initial filter. For example, if the initial filter is on diagram properties, the list for any subsequent filters for the search only contains the Diagram option"

http://www.sparxsystems.com/enterprise_architect_user_guide/10/navigate_search_and_trace/adding_filters.html

But like everyone else, I can't find this option, did it exist and was removed????
« Last Edit: September 15, 2013, 01:06:00 am by realitystorm »

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Search for diagram with name
« Reply #8 on: September 16, 2013, 10:10:58 am »
I'll have to admit that the quoted text is not very clear.  I have edited it to read:

If you are adding filters to an existing search, the list contains only items appropriate to the initial filter.

For example:

  • If the initial filter is set to search on Element, the drop-down list for subsequent filters on the search will show a long list of element properties that you can filter more specifically on
  • If the initial filter is set to search on Diagram, the list for any subsequent filters for the search only contains the Diagram option, as there are no other filters that can be applied to a search on diagrams
[/i]If you experiment with new searches and new filters, you will see that the possible values for the Search On field are themselves filtered by the type object you are performing the search on.
Best Regards, Roy

stevesavage

  • EA User
  • **
  • Posts: 119
  • Karma: +4/-0
    • View Profile
Re: Search for diagram with name
« Reply #9 on: September 17, 2013, 01:39:29 am »
Hi RoyC, I understand that.
Unfortunately "Diagram" does not show up in the "Search On" list (the initial filter), Element, Attribute etc. do, but not Diagram.

In the manual it shows Diagram in the "Search On" list:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/navigate_search_and_trace/adding_filters.html

Am I looking in the wrong spot?

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Search for diagram with name
« Reply #10 on: September 17, 2013, 10:06:14 am »
No, you are looking in the right place but Diagram only appears for the first brand new filter on, effectively, a brand new search.

In the Search Builder, right-click on the body of the Search Builder tab and select the New Search context menu option. Type in a name - say, DiagSearch. The Editor Type radio button is selected by default. Click on the OK button. So, the Search Builder tab should be clear.

Right-click on the body of the Search Builder tab again and select the Add Filter option. On the Add Filters dialog, the Search On field defaults to Element. Click on the drop-down arrow and see that the second item on the list is Diagram. Select it! Quick!

This gives you a search on a small group of diagram properties, which you can enable and set values for as necessary. Click on the OK button.

In theory, you could select to add another filter to this search, in which case the drop-down arrow on the Search On field would show you Diagram and only Diagram - you can't mix any other object type search into the Diagram search. In practice, I'm not sure that adding another filter would give you anything you couldn't acheive with the first, single filter.

If you had selected Element for the first filter, or indeed pretty much any option other than Diagram, the Search would have to act initially on an element and thereafter you could add more filters on a number of element properties. So the Search On field would continue to offer several options, but not Diagram because you can't mix the Diagram filter into an Element search.

I hope that helps.
« Last Edit: September 17, 2013, 10:08:14 am by RoyC »
Best Regards, Roy

skiwi

  • EA Expert
  • ****
  • Posts: 2080
  • Karma: +46/-82
    • View Profile
Re: Search for diagram with name
« Reply #11 on: September 25, 2013, 11:17:45 am »
Roy

the way I see it is that a search (ctrl-F), simple or extended, returns no diagrams in the results even if the search term is in the diagram name.

In fact from a usability point of view it seems impossible to search for diagrams using a specific name or keyword.

How about improving EA do it can find diagrams in the search. Perhaps a built in "diagram" search would do the trick.

« Last Edit: September 26, 2013, 06:38:59 am by skiwi »
Orthogonality rules
Using EA16.1 (1627) on Windows 11 Enterprise/64 bit. Repositories in SQLServer2019 DB Schema 1558.
WebEA on Pro Cloud Server 4.2.64