Author Topic: Accessing the versions of a diagram through API  (Read 824 times)

vkc1020

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Accessing the versions of a diagram through API
« on: September 06, 2019, 06:11:18 am »
Is there a way to find out if a given diagram has multiple versions of itself in the repository through API?

The one way I thought of accessing the package which 'owns' this diagram and iterating through its diagrams to see if there ones with the same name and with a different version (diagram.Version). But this I figured would be inefficient and would like to know if there is a more direct approach to checking if there are multiple versiosn fo the diagram API-wise.

Thank You

qwerty

  • EA Guru
  • *****
  • Posts: 10505
  • Karma: +231/-190
  • I'm no guru at all
    • View Profile
Re: Accessing the versions of a diagram through API
« Reply #1 on: September 06, 2019, 07:02:16 am »
How can a diagram have different versions of itself at all??

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6800
  • Karma: +142/-103
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Accessing the versions of a diagram through API
« Reply #2 on: September 06, 2019, 08:12:55 am »
How can a diagram have different versions of itself at all??

q.
Well, Sparx has provided a version field for the Diagram item.  So, I guess, by definition, multiple diagrams with the same name but different version field values are "Different versions of the same diagram"  (Notwithstanding that their content may be wildly different)  ;).

Happy Friday everyone!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9392
  • Karma: +258/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing the versions of a diagram through API
« Reply #3 on: September 06, 2019, 01:46:15 pm »
The API has an operation Repository.SQLQuery that you can use for things like this.

Geert

vkc1020

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Accessing the versions of a diagram through API
« Reply #4 on: September 06, 2019, 05:37:32 pm »
Thank you Geert!

Is there a link to how to frame this query? Or a Sparx Systems documentation that has information on all the parameters in in the different SQL Tables for an Enterprise Architect Model?

Thank You!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9392
  • Karma: +258/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

vkc1020

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Accessing the versions of a diagram through API
« Reply #6 on: September 07, 2019, 05:19:29 am »
Thank you Geert!

As per resources online, I tried accessing the SQL Table within EA, but the Search bar in the SQL Scratch Pad is greyed out / disabled for some reason.
Do you have any idea if I should be changing some settings to enable this search feature ? I could not find much online.

Thank You

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9392
  • Karma: +258/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing the versions of a diagram through API
« Reply #7 on: September 07, 2019, 03:56:25 pm »
There's a run button that you can use to see the results of your SQL Query.

Geert