Book a Demo

Author Topic: Dependencies between packages  (Read 75757 times)

Erik Forsling

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Dependencies between packages
« on: September 15, 2025, 05:57:24 pm »
Hi,
I working within a large organization, where we have many models and packages which are shared, and thus managed on corporate level. When working with a "local" package I find myself constantly worrying about accidently changing something that I shouldn't. I'm not sure if this is a feature request, or if there is actually a way to find all objects referenced in my diagrams which are not part of my packages, if you get what I mean. Surely there should at least be a way to build such a search/query?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Dependencies between packages
« Reply #1 on: September 15, 2025, 06:25:58 pm »
A search is pretty easy to make

Code: [Select]
select o.* from t_object o
inner join t_diagramobjects dod on dod.Object_ID = o.Object_ID
inner join t_diagram d on d.Diagram_ID = dod.Diagram_ID
where d.Package_ID in (#Branch#)
and not o.Package_ID in (#Branch#)

Geert

Erik Forsling

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Dependencies between packages
« Reply #2 on: September 15, 2025, 06:43:25 pm »
Thanks!
I will experiment with this on some of my use cases!
From the looks of it (I know some SQL but I'm not to familiar with the schema in EA) this will cover one specific package. Would it be possible to cover a whole package structure in the same manner, recursively? Maybe that would require to first form a list of all package-IDs in a structure, and put in #Branch#).

Oh, that yields another question. Which version of (MS?) SQL is in EA? Is it able to process Common Table Expressions (CTEs)?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Dependencies between packages
« Reply #3 on: September 15, 2025, 07:01:36 pm »
Thanks!
I will experiment with this on some of my use cases!
From the looks of it (I know some SQL but I'm not to familiar with the schema in EA) this will cover one specific package. Would it be possible to cover a whole package structure in the same manner, recursively? Maybe that would require to first form a list of all package-IDs in a structure, and put in #Branch#).

Oh, that yields another question. Which version of (MS?) SQL is in EA? Is it able to process Common Table Expressions (CTEs)?
That's what the #Branch# macro does for you. It will be replaced by EA by the package ID of the selected package, and all packages in that branch in a comma separated list.
This avoids the need for CTE's

This query returns all objects that are from a different branch, but used on a diagram in this branch.

Geert

Erik Forsling

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Dependencies between packages
« Reply #4 on: September 15, 2025, 11:15:27 pm »
Wow. You just made my day. I had no idea that existed. Need to dive into query building I guess. This is super handy. Thank you so much.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Dependencies between packages
« Reply #5 on: September 15, 2025, 11:37:30 pm »
On this page you'll find the documentation of all supported macro's

https://sparxsystems.com/enterprise_architect_user_guide/17.1/the_application_desktop/creating_filters.html

Geert

Elpis

  • EA User
  • **
  • Posts: 64
  • Karma: +7/-0
  • Make MDA/MBSE vital.
    • View Profile
Re: Dependencies between packages
« Reply #6 on: September 16, 2025, 12:52:31 am »
That's what the #Branch# macro does for you. It will be replaced by EA by the package ID of the selected package, and all packages in that branch in a comma separated list.

But EA documentation, you mentioned in later post, says: "[...] gets the ID of each child Package of the parent Package selected by the user". If I read it correctly, it means, child packages (recursively) only, without the selected parent package itself... I didn't check whether the documentation is right or wrong, though. (Or I am wrong with interpretation of it.)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Dependencies between packages
« Reply #7 on: September 16, 2025, 03:09:28 pm »
That's what the #Branch# macro does for you. It will be replaced by EA by the package ID of the selected package, and all packages in that branch in a comma separated list.

But EA documentation, you mentioned in later post, says: "[...] gets the ID of each child Package of the parent Package selected by the user". If I read it correctly, it means, child packages (recursively) only, without the selected parent package itself... I didn't check whether the documentation is right or wrong, though. (Or I am wrong with interpretation of it.)
Regardless of what the documentation says, it includes the selected package as well.

Geert