Author Topic: DBMS -> EAP  (Read 6848 times)

SkiRat

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
DBMS -> EAP
« on: November 11, 2010, 07:30:36 am »
What's the best way to convert from MySQL to an EAP file?
It's easy inside of EA but don't want to do it that way.
Preferably by the API

Any ideas?
thanks for your help

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: DBMS -> EAP
« Reply #1 on: November 11, 2010, 10:15:41 am »
The Project Transfer feature is not available via the automation interface at this time.  The only way you could transfer information at the moment would be via XMI, but this will not copy across all reference data, etc from the original model.

SkiRat

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: DBMS -> EAP
« Reply #2 on: November 12, 2010, 01:22:10 am »
The eap file is a MS Access DB file;

$ file New1.eap
New1.eap: Microsoft Access Database


Is there a way to go from MySQL to MS Access then to an EAP?
thanks for your help

Krzysztof Swiatkowski

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
  • Understanding is a three-edged sword
    • View Profile
Re: DBMS -> EAP
« Reply #3 on: November 12, 2010, 01:18:00 pm »
Just curious... Why don't you simply copy contents of all tables by hand? AFAIK EA does exactly that when performing project transfer. I would assume that in Windows environment you could use almost any programming tool to access MSAccess database via OleDB. And there must be similar way (OleDB, ODBC, native) to access MySQL. From there it is rather boring than complicated.

Regards
Kris
If I put you finger in the eye
then you have finger in the eye
and I have finger in the eye
but it's not the same

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: DBMS -> EAP
« Reply #4 on: November 12, 2010, 03:27:33 pm »
Quote
Just curious... Why don't you simply copy contents of all tables by hand? AFAIK EA does exactly that when performing project transfer. I would assume that in Windows environment you could use almost any programming tool to access MSAccess database via OleDB. And there must be similar way (OleDB, ODBC, native) to access MySQL. From there it is rather boring than complicated.

Regards
Kris
It's not that simple Kris...

When transferring DBs, EA preserves the IDs (as it should).  To do this, it performs a "bit of magic" behind the scenes.

It may be better to issue some SendKeys to trigger the manual transfer.

Better still, of course, would be to have EA use it's own API to do its processing.  So we'd be able to do what it can do.

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

Krzysztof Swiatkowski

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
  • Understanding is a three-edged sword
    • View Profile
Re: DBMS -> EAP
« Reply #5 on: November 13, 2010, 02:14:20 am »
You're right Paolo but this can be accomplished by droping and restoring those constraints or disabling them.
I think you could also try creating in memory mapping to simply transform ID's on the go but this would require quite some knowledge about what ID's are stored where. Disabling or temporarly droping constraints is much simpler.
It is more work though than I assumed initially. And undoubtedly I agree it would be better to do it via API.
On the other hand - error information EA provides during these transfers even in log file isn't too useful :( so maybe writing one's own transfer could prove beneficial :).

Regards
Kris
If I put you finger in the eye
then you have finger in the eye
and I have finger in the eye
but it's not the same

SkiRat

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: DBMS -> EAP
« Reply #6 on: November 13, 2010, 02:35:04 am »
I want to keep this logical and simple;

An eap file can be renamed as a mdb file and opened in MS Access.

Also, if you open MS Access and create some project you can import the MySQL EA schema via an ODBC connection and populate it into Access. It works! All the tables that are used by EA are preserved.

But that new DB file created from MS Access can't be opened by EA if the eap extension is added to it.

The error message says;
[size=12]An Error has Occurred: Unrecognized database format[/size]

now what?
thanks for your help

Krzysztof Swiatkowski

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
  • Understanding is a three-edged sword
    • View Profile
Re: DBMS -> EAP
« Reply #7 on: November 13, 2010, 11:11:09 am »
Depends on what version of access you are using. One of the things that might help is checking "Use Jet 4.0" in options. That should work for Access 2000 and probably 2003.

You can check if database is OK by treating mdb file as server database and configuring OleDB connection to it. (Start Page -> Connect to server)

HTH
Regards
Kris
If I put you finger in the eye
then you have finger in the eye
and I have finger in the eye
but it's not the same

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1316
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: DBMS -> EAP
« Reply #8 on: November 16, 2010, 05:30:40 pm »
Quote
It's easy inside of EA but don't want to do it that way.
Preferably by the API

You haven't explained why you want to use an alternative way to that is provided by EA so not sure of the motivation here. However you can try using one of the many ETL tools available such as powercentre or SAS data integration studio if you can afford it.

Alternatively if you are just looking for ways to inflict pain on yourself put the crown jewels on the table and hit each one with a hammer  :) (Joke)
Happy to help
:)

SkiRat

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: DBMS -> EAP
« Reply #9 on: November 18, 2010, 04:07:09 am »
Solution:

Here's the methods with params I used to create an EAP file
run in this order;

Class Project

 project.ExportPackageXMI(packageGuid1, EnumXMIType.xmiEA11, 2, 3, 1, 0, "/tmp/MyFile.xml")

Class Repository

 repository.CreateModel(CreateModelType.cmEAPFromBase,"/tmp/Model.eap", 0)

Class Project

repository.GetProjectInterface().ImportPackageXMI(packageGuid2,"/tmp/MyFile.xml" ,1,1)

It actually wasn't that bad and a complete EAP based from the database is created.

Also, use the  string that looks something like this;

String EA_DB = "ea_reposi --- DBType=0;Connect=Provider=MSDASQL.1;Persist Security Info=False;Data Source=ea_repository";

To connect to your repository.

PS
[size=8]mary jane is Open
ski free or die[/size]

thanks for your help

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13381
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: DBMS -> EAP
« Reply #10 on: November 18, 2010, 05:01:10 pm »
SkiRat,

That will indeed copy the packages, but it won't do anything for things like settings, users, defined stereotypes etc...

Geert