Book a Demo

Author Topic: Import several XMI files at once  (Read 4754 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Import several XMI files at once
« on: January 10, 2014, 09:15:40 pm »
Hi

Is there any script or plug-in available that makes it possible to import a selection of XMI files into the model within the selected package from the Project Browser?
A customer needs to import dozens of XMI within an EA project, so they're looking for a solution preventing from executing it once every file.

thanks
Guillaume
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Import several XMI files at once
« Reply #1 on: January 10, 2014, 10:36:59 pm »
You can run a script that calls ImportPackageXMI for all files. It should be a task for an hour or so.

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Import several XMI files at once
« Reply #2 on: January 24, 2014, 04:16:11 pm »
Thanks for the info. I got it to work and I'm looking at improving it.
I'd like to set a collection variable to let the user add as many XML files as needed.
I found from EA script samples the following object :
dim theDictionary
set theDictionary = CreateObject( "Scripting.Dictionary" )
theDictionary.Add "a", "Alpha"

As I don't need the key is there a simpler "array" like object to use in VBScript?

Thanks
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Import several XMI files at once
« Reply #3 on: January 24, 2014, 10:21:04 pm »
Maybe you'll get an answer here, but that's better asked at StackOverflow.

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Import several XMI files at once
« Reply #4 on: January 28, 2014, 08:08:26 am »
Thanks, I found what I was looking for :

Set fileList = CreateObject("System.Collections.ArrayList")

I will shortly post an article on the community site to publish my script once it's done.

Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Import several XMI files at once
« Reply #5 on: January 28, 2014, 10:26:31 am »
Thanks :-)

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Import several XMI files at once
« Reply #6 on: January 30, 2014, 06:41:56 pm »
The article has been submitted on the Sparx community site (should be available soon), and published here as well :

http://www.umlchannel.com/en/enterprise-architect/item/77-sparxsystems-enterprise-architect-script-xmi-file-batch-import

This script can be improved, but so far it's been working well.
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com