Book a Demo

Author Topic: saving a copy of EA project from automation  (Read 7331 times)

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
saving a copy of EA project from automation
« on: November 08, 2007, 01:58:57 am »
Hello,

is there a way of saving a copy of an opened EA project into another file via automation? (just like Save Project As and selecting Type of Save = Copy)

Thanks.

Radek
Radek

thomaskilian

  • Guest
Re: saving a copy of EA project from automation
« Reply #1 on: November 08, 2007, 04:07:25 am »
I guess not. The project interface has a SaveControlledPackage. You could try to fiddle around by copying the XMI and saving. No idea whether that could help?

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
Re: saving a copy of EA project from automation
« Reply #2 on: November 08, 2007, 05:58:01 am »
...and I can always (via automation) run export to XMI for each model in the project, take an empty EA project and import all the models XMI into it...
I've only wondered whether there is an easier way to achieve the same by simply Saving the project via automation somehow...
Radek

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: saving a copy of EA project from automation
« Reply #3 on: November 08, 2007, 02:31:59 pm »
Would assume you could just use the relevant file system API calls for whatever language you are using to copy the EAP file.  Should probably make sure to close the file before copying however if you are accessing it through automation at the time.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: saving a copy of EA project from automation
« Reply #4 on: November 08, 2007, 05:26:29 pm »
This whole behavior is a throwback to times of EA 4 and earlier, where you had to manually copy a 'seed' project to start a new file. I guess the logic then was 'since you already copied the file that covers the whole save as issue.'

Aaron is quite correct. It's actually very little trouble to copy the file using a call to the file system. Solves the problem with very little fuss and bother.

[Yes, I agree it looks a bit strange not to have a save as feature, but it works just fine.]

David
No, you can't have it!

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
Re: saving a copy of EA project from automation
« Reply #5 on: November 09, 2007, 02:36:40 pm »
Well, actually I wanted to save a project stored on the SQL server to an EAP file and since it is quite easy directly from EA it might have been possible via Automation as well... ;-)
Radek

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: saving a copy of EA project from automation
« Reply #6 on: November 09, 2007, 03:27:30 pm »
If you're using SQL Server 2005 write yourself a bulk copy script. The script should copy a blank seed project - one built from the script Sparx supplies - to a new database. Of course you'll need to set permissions correctly, but you'd need to do this for a manual copy anyway.

You should be able to trigger this script from automation - of SQL Server rather than EA - although it could be part of a program that handles both applications.

You might want to set up the seed project first. What I've done is create an EAEmpty project - basically a copy of EABase with just about everything cleared out, and with my corporate standards set in options, reference data and such.  This might save you having to somehow trigger a Project Transfer operation through automation, not an easy task.

David
No, you can't have it!