Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: dbetsing on January 29, 2011, 02:04:51 am

Title: Search Sequence Diagrams
Post by: dbetsing on January 29, 2011, 02:04:51 am
I'm new to EA and am attempting to find a way to search for all sequence diagrams where a method is used.  Can anyone tell me if there is a way to do that?
Title: Re: Search Sequence Diagrams
Post by: Geert Bellekens on January 31, 2011, 07:53:32 pm
Try this one:
Code: [Select]
select distinct d.ea_guid as CLASSGUID,d.Diagram_Type as CLASSTYPE,d.name as 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_connector c
inner join t_diagram d on c.diagramID = d.diagram_id)
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 c.name like '#WC#<Search Term>#WC#(#WC#)'
and d.Diagram_Type = 'Sequence'

Geert
Title: Re: Search Sequence Diagrams
Post by: dbetsing on February 09, 2011, 09:06:57 am
Quote
Try this one:
Code: [Select]
select distinct d.ea_guid as CLASSGUID,d.Diagram_Type as CLASSTYPE,d.name as 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_connector c
inner join t_diagram d on c.diagramID = d.diagram_id)
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 c.name like '#WC#<Search Term>#WC#(#WC#)'
and d.Diagram_Type = 'Sequence'

Geert

Thanks for the post.  I apologize for not getting back earlier, but when I copied and pasted the above into the sql search, it didn't work. (I got the column headings but couldn't get any results).  My assumption is that I am not using EA correctly or I don't recall enough sql to use the above correctly, so I wanted to investigate further before coming back and just haven't gotten time yet.  
Title: Re: Search Sequence Diagrams
Post by: Geert Bellekens on February 09, 2011, 06:29:23 pm
This search works based on the name of the messages in sequence diagrams, assuming that the always have both parentheses "(" and ")".

So to find a sequence diagram that contains a message with the name
"getAllMembers(Category)" you should type in "getAllMembers" in the search box (or "getAllM") or something like that.
Can you confirm that your messages on sequence diagrams contain the parentheses?

If you are looking for a solution to nagivate directly from operations to sequence diagrams and vice-versa you can use the free EA Navigator Addin (http://community.sparxsystems.com/resources/scripts/navigator-addin-navigate-operations-sequence-diagrams-and-vice-versa) I published on the community site.

Geert
Title: Re: Search Sequence Diagrams
Post by: dbetsing on February 12, 2011, 05:06:25 am
Thanks alot.  That helped immensely.  As expected, the problem was not understanding how to build an SQL search.  Whatever I did before was wrong.  Going through the help, I entered the SQL correctly and your script worked excellent.   Thanks Again!!!