Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: vkc1020 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
-
How can a diagram have different versions of itself at all??
q.
-
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
-
The API has an operation Repository.SQLQuery that you can use for things like this.
Geert
-
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!
-
There are plenty of examples in my code:
- VBScript: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/search?q=SQLQuery&unscoped_q=SQLQuery (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/search?q=SQLQuery&unscoped_q=SQLQuery)
- C# https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/search?q=SQLQuery&unscoped_q=SQLQuery (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/search?q=SQLQuery&unscoped_q=SQLQuery)
And there's qwerty's book about the database structure:https://leanpub.com/InsideEA (https://leanpub.com/InsideEA)
Geert
-
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
-
There's a run button that you can use to see the results of your SQL Query.
Geert