Book a Demo

Author Topic: Finding remote diagram elements  (Read 5071 times)

Charles England

  • EA User
  • **
  • Posts: 27
  • Karma: +1/-0
    • View Profile
Finding remote diagram elements
« on: March 16, 2016, 11:16:55 pm »
I'm doing some repository cleaning, and I'm trying to find all elements under one root node (an archive node) that are still referenced by diagrams in a different root node (the live data) so i can move them back to the correct node.
Any thoughts?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Finding remote diagram elements
« Reply #1 on: March 16, 2016, 11:31:18 pm »
you could write an SQL Search that lists all of them
Something like this should work

Code: [Select]
select distinct o.ea_guid as CLASSGUID,o.Object_Type as CLASSTYPE,o.Name as Name,d.name as DiagramName ,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_diagramobjects do on do.Diagram_ID = d.Diagram_ID)
inner join t_object o on o.Object_ID = do.Object_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
o.Package_ID in (#Branch#)
and d.Package_ID not in (#Branch#)

Geert

Charles England

  • EA User
  • **
  • Posts: 27
  • Karma: +1/-0
    • View Profile
Re: Finding remote diagram elements
« Reply #2 on: March 17, 2016, 01:02:24 am »
Excellent,
It must have been my explanation, but it works perfectly having exchanged the IN and NOT IN in the last two lines.
Thank you Geert.