Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: survex on September 14, 2014, 02:44:40 am

Title: How to manage EAP on DBMS via SQL?
Post by: survex on September 14, 2014, 02:44:40 am
Hello, I'm sure this question had been asked here, but I can't find any thread about it.

Say I have EA project on DBMS and I want to add/change some information in project automatically (add reports, add diagrammes etc.). The only way I can do it is to change project database via SQL. Is there any examples or tutorials teaching how to solve this problem?

Thank you.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: qwerty on September 14, 2014, 06:36:58 am
I suggest to start with the API before manipulating the database directly. Have a look into my Scripting and Inside books.

q.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: survex on September 14, 2014, 07:27:38 am
Is it possible to use api for DBMS Repository? Cause all examples use file [r.OpenFile("c:\\eatest.eap");].
I'm implementing EA for PHP project so it would be very inconvenient to use on of the following languages: C#, Java which use API.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: qwerty on September 14, 2014, 07:07:52 pm
Yes, sure. I use Perl quite often, but PHP should be possible too. You can create an EA instance and work with that. In order to access a RDBMS you need to supply an ODBC connection string which you get from the context menu in the Open dialog in EA. Just pass that to the Repository.OpenFile API call.

I guess that when you are talking about PHP you're mainly after reading the database with SQL. In that case you can also live without the API since it's more or less just a thin layer on top of the database.

q.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: survex on September 14, 2014, 07:25:58 pm
Yes, I've got the point. So I don't need API, but what I'm looking for is some tutorial of managing DB of EA project. For example:
- how to add new package
- update notes of package

I haven't found question by myself, cause simple SQL-UPDATE query doesn't update notes in EA.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: qwerty on September 14, 2014, 07:55:19 pm
So it's not just reading. If you try to create packages you need to touch two tables and interlink them. That's much easier with the API. You should be familiar with scripting/the EA object model before attempting anything of what you mentioned (applies also for the notes update for packages).

q.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: survex on September 14, 2014, 09:46:38 pm
As I see EA API is not crossplatform solution (uses dll, so I can't use in linux server). So the easieast way for me would be to sniffer SQL-queries on some actions during manual work and to use those queries for automatization.
Title: Re: How to manage EAP on DBMS via SQL?
Post by: qwerty on September 15, 2014, 06:19:25 am
Good luck then. It took me a couple of years to find out how that all worked before putting that knowledge in my book. And that was AFTER having understood the API.

q.