Book a Demo

Author Topic: Only objects within a single root tree  (Read 4519 times)

Rudy

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Only objects within a single root tree
« on: September 25, 2010, 09:45:52 pm »
I hope this is the right location to ask, and I sure hope someone will be able to help me.

Within EA, within a single EAP file, I have multiple roots (more projects).

With SQL statements (e.g. Excel accessing the eap as MS Access DB) I am looking for all the objects (t_object) within a single tree, not showing the objects from another tree.

With my lack of SQL knowledge, I hope you experts can help me complete the query for that.

"SELECT t_object.name
FROM t_object
WHERE t_object.object_type = '<some type'
AND t_object.folder IN (<what do I put in here?>)"

Thank you in advance for your help.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Only objects within a single root tree
« Reply #1 on: September 27, 2010, 03:23:39 pm »
Rudy,

The problem with this kind of searches is that you need a recursive function to get all the elements in a package (or its subpackages).
Although some databases support recursive queries I haven't managed to get this working with EA.
So then the options are:
- Create a script/addin that recurses the elements in code (very slow, especially for larger models)
- Create an SQL query that goes "deep enough". I've used this option in some of my addins, look at this topic for the (sql) code.

Geert

Rudy

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Only objects within a single root tree
« Reply #2 on: October 18, 2010, 10:24:57 pm »
Thank you Geert,

Not what I wanted to hear, but in line with my expectation.
I was hoping EA would be able to provide support for this. I cannot imagine that I am the only one who is looking for this kind of information.