Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: japanfather on May 27, 2014, 09:19:45 pm

Title: How to convert many .EAP files into XMI files?
Post by: japanfather on May 27, 2014, 09:19:45 pm
Hello everyone,

I have 120 .EAP files. I would like to convert these files into .xmi files (a batch-type manner). Should I implement a script or add-in in Enterprise Architect to transfer them? Please help me. Thank you! :)
Title: Re: How to convert many .EAP files into XMI files?
Post by: Helmut Ortmann on May 27, 2014, 09:34:21 pm
Both is possible. Use the method you like most.

Usually the start with scripting is easier because you don't need the Addin stuff.

Helmut
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on May 28, 2014, 12:19:56 am
Maybe you should tell use why you would do that transfer.

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: japanfather on May 28, 2014, 01:47:58 am
Thank you to reply.

Maybe using script is easier especially in Linux shell script. Does Enterprise Architect support command in DOS or Linux?

I got this mission from my friend but I do not know his purpose:D
Title: Re: How to convert many .EAP files into XMI files?
Post by: Helmut Ortmann on May 28, 2014, 02:33:40 am
In EA you may use:
- VBScript
- JScript
- JavaScript

There's also a degugger available to make testing a lot easier.

Helmut
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on May 28, 2014, 03:19:53 am
Quote
Thank you to reply.

Maybe using script is easier especially in Linux shell script. Does Enterprise Architect support command in DOS or Linux?

I got this mission from my friend but I do not know his purpose:D
Then you should the hell kick him and tell you why ;)

From where, to where, for what purpose?

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: japanfather on May 28, 2014, 01:26:00 pm
I will try to use JScript or JavaScript in EA and the debugger. I also will force my friend to tell his purpose  ;)
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 03, 2014, 12:54:21 am
Hi all, I also need this as I have many models and I want to compare these models by comparing the XMI files, instead of doing this for each
file, I want to convert it once.  So could you help me ::)?!
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 03, 2014, 04:01:42 am
Exporting a model via a script is fairly easy by using ExportPackageXMI from the project interface. But why the heck do you want to compare XMI? That sounds quite lunatic (sorry for the harsh words, but I can't find anything more reasonable).

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: Helmut Ortmann on June 03, 2014, 04:42:29 am
If you want to compare *.xmi files you may ask Stefan Bolleininger. If I remember right I has done something.

If I remember right in the community is something about batch import/export.

Besides all: Comparing *.xml files isn't an easy job. If you are able to reduce the compare to a small subset it might be useful. If you want to compare full UML than you have a great task and you possibly will fail.

Helmut
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 04, 2014, 12:08:43 am
anyway let me try, I want to start with class diagram. how I can export class diagram for 10 EAP file to xmi, and how to specify which version of xmi I want (1.3, 2.00, ...) is it possible or I have to do it manually ::)
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 04, 2014, 12:12:42 am
You can't even manually export a diagram.

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 04, 2014, 12:37:51 am
Sorry, I mean export class diagram in .EAP file into XMI file. But I want to know how I can do this automatically for 10 EAP files.
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 04, 2014, 02:22:17 am
I already said: you can't export a diagram, except as bit image.

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 04, 2014, 02:58:22 am

Project --> Model Import/Export --> Export Package to XMI

from this you can export diagram to XMI file  :-?


Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 04, 2014, 04:30:11 am
No. It's a package which you export. Not a diagram. So is it that? Export a package?

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 05, 2014, 07:36:16 pm
yes, I do like this. can I do this automatically?!
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 05, 2014, 07:52:48 pm
Yes. You can export a package automatically. Use EAProjectInterface.ExportPackageXMI (see help for details)

Note that version control allows to save a package stub as XMI. This can't be done with the above (or you need to use ExportPackageXMIex). So if you export a package it will include all sub-packages.

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 05, 2014, 08:17:14 pm
I will try, do you have an example, or tutorial
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 05, 2014, 08:39:34 pm
You might look into my Scripting book (shameless self plug) but that does not detail the above mentioned method.

Of course it depends on the language you want to use. To access the project interface object you need to retrieve it via EARepository.GetProjectInterface ()

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 05, 2014, 09:52:16 pm
could you give me the link of your book, or where I can found it, please
Title: Re: How to convert many .EAP files into XMI files?
Post by: qwerty on June 05, 2014, 11:32:24 pm
It's the banner below my posts :-)

q.
Title: Re: How to convert many .EAP files into XMI files?
Post by: usermark on June 06, 2014, 01:26:46 am
Ohh thanks, I will share you when I succeed with the scripts
thank you