Book a Demo

Author Topic: Automate export of XMI  (Read 7631 times)

Culpers

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Automate export of XMI
« on: October 15, 2008, 12:50:19 am »
Is there a way of using the automation interface to export one or more packages as XMI similar to the function found in the EA application?
If so, can this be run from the command line rather than via an add-in?

Any help gratefully received.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Automate export of XMI
« Reply #1 on: October 15, 2008, 01:38:08 pm »
Yes, using the Project.ExportPackageXMI method.

No, not as yet.
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Automate export of XMI
« Reply #2 on: October 15, 2008, 07:32:07 pm »
Quote
No, not as yet.

Why not? You can make a command line application with anything that understands COM, create a new EA.Repository, open a project with its OpenFile method and then iterate through the packages and export e.g. the ones with names matching command line parameters.

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Automate export of XMI
« Reply #3 on: October 15, 2008, 08:52:22 pm »
Quote
Quote
No, not as yet.

Why not? You can make a command line application with anything that understands COM, create a new EA.Repository, open a project with its OpenFile method and then iterate through the packages and export e.g. the ones with names matching command line parameters.

Just did something similar and added it via the Tools menu to EA.
The JAVA program gets its input package guid as a parameter via main(arg0) and then processes it.
It works the same way from the command line. The only challenge is to get the input package GUID to be pasted as command line parameter which is a bit cumbersome. Called from EA it can be automatically set from the item selected. Make sure to check in your program whether the input GUID is really a package to avoid surprises.

It is very straightforward. The JAVA API is nothing but a wrapper for the COM API so it works the same way with C++, C# and any other wrapper available.

Oliver
« Last Edit: October 15, 2008, 08:54:52 pm by ofels »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Automate export of XMI
« Reply #4 on: October 15, 2008, 10:40:05 pm »
Sorry about that all - and even more so to Culpers.

Frank and Oliver are completely correct of course. [Not to suggest that we would expect otherwise.   ;) ]

What I meant was that EA would not (yet) do this by itself. You can certainly do this via an external automation application.

The above said, I wonder if we could - either in future or with the currently-available technology - set up an add-in to capture the OpenFile event (or any other kind of application startup) and 'cut in' at that point. The idea would be to do this from 'within' EA rather than starting some other application. This might be turned on and off by registering or removing the add-in (somehow, perhaps via the current means) in the default configuration. Perhaps an additional option could be added, or set via an add-in menu, to trigger the intervention on startup.

David
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Automate export of XMI
« Reply #5 on: October 16, 2008, 04:27:32 am »
Quote
I wonder if we could - either in future or with the currently-available technology - set up an add-in to capture the OpenFile event (or any other kind of application startup) and 'cut in' at that point.

Using the EA_FileOpen broadcast event this should be no problem.

But having a command line application to export packages from a given EA project can be nice when you create code from xmi and want a batch for the build process. Alternatively you may want do run the complete build process from an EA AddIn.

As yet we are exporting manually and running the xsl transformations for code generation in a sort of half automated application, but as more and more definitions move from code to model we will have to decide whether we want a batch or an AddIn (or both).

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Automate export of XMI
« Reply #6 on: October 16, 2008, 07:40:48 pm »
Quote
Sorry about that all - and even more so to Culpers.

Frank and Oliver are completely correct of course. [Not to suggest that we would expect otherwise.   ;) ]

I have waited for long on that occasion- proving that David is wrong and slap him on the back for this  ;D
It took quite a while and dozens of excellent posts have past until I finally found one- strike :D

Oliver

P.S.: Just kidding ;)

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Automate export of XMI
« Reply #7 on: October 17, 2008, 12:35:51 am »
Touché!

The important thing here is that you've found something to fill the empty hours.   ;D
No, you can't have it!

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Automate export of XMI
« Reply #8 on: October 17, 2008, 12:49:04 am »
Quote
Touché!

The important thing here is that you've found something to fill the empty hours.   ;D

Propably those hours of time shift between Canada and Europe- you guys wake up too late :)

Oliver

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Automate export of XMI
« Reply #9 on: October 17, 2008, 12:53:46 am »
Ahem!

Mister Excitement (that would be yours truly) does not sleep, he rests.

Mister Excitement does not not doze or daydream, he contemplates.

Mister Excitement is not late, he is delayed elsewhere.

A little respect here, please...   :-X
No, you can't have it!

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Automate export of XMI
« Reply #10 on: October 17, 2008, 07:04:48 pm »
Quote

A little respect here, please...   :-X

============

No, you can' t have it

That quote and the sig make a good combination :)

Besides that I get the feeling of having been misunderstood, but maybe this is caused by the language barrier. Take my apologies uin that case.

Oliver

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Automate export of XMI
« Reply #11 on: October 18, 2008, 02:03:04 am »
No apology necessary. I took your original comment as intended. My reply was also meant in jest.

PS: And don't they (make a nice combination). I'd somehow managed not to notice that when I posted.   :-[
« Last Edit: October 18, 2008, 02:04:03 am by Midnight »
No, you can't have it!