Book a Demo

Author Topic: Element and Diagrams  (Read 6155 times)

Greenbolt

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Element and Diagrams
« on: October 04, 2019, 11:49:16 pm »
Hi everyone,

I am writing something with the EA API in Java. I was wondering, when having an Element, if it is possible to find one or more DiagramID, where that Element is part of.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Element and Diagrams
« Reply #1 on: October 04, 2019, 11:53:44 pm »
You can traverse the whole model, and for each diagram iterate it's diagramObjects to figure out if one of those uses the same ElementID as your current element.

Or you can use Repository.SQLQuery to get the diagramID's of the diagrams that show your element.
and then use Repository.GetdiagramByID to get the diagramObject.

Something like
Code: [Select]
select do.Diagram_ID from t_diagramobjects do
where do.Object_ID = <myElementID>

Geert

Greenbolt

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Element and Diagrams
« Reply #2 on: October 04, 2019, 11:54:45 pm »
Awesome, I will look into the Repository SQLQuery. Thanks a lot!