Book a Demo

Author Topic: Automatic Data Transfer option  (Read 2901 times)

sbhuma

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Automatic Data Transfer option
« on: October 26, 2006, 10:19:39 am »
Hi,
       Can anyone please do let me know, how can I do automatic Data Transfer for EA Repository to EAP file (backups )?

If there are any APIs for the same, let me know.

-Thanks,
Sri.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Automatic Data Transfer option
« Reply #1 on: October 26, 2006, 10:56:43 am »
Hi Sri,

I did something roughly similar back in the EA 4.1 days. It was a bit kludgy but it worked.

The way I went about it was:
  • Create a completely empty project in an EAP file. This requires emptying out, for example, the glossary or other items you don't want in all your projects. This becomes your reference file (for lack of a better term).
  • Make a copy of this reference file through whatever programmatic interface your application uses. This will be your backup project.
  • Open the project you want to back up. You can do this with a second EA.Repository. Capture the GUID of the top-most package (i.e. the model itself).
  • Use the ExportPackageXMI method of the Project Interface to export the model to a file. NB:
    • EA does not have an equivalent function to export to a string variable.
    • You will have to convert the GUIDs to and from the form required by the Project Interface. You can do this with the GUIDtoXML and XMLtoGUID methods.

  • Open your new backup project and get the GUID of the model element.
  • Use the ImportPackageXMI method to import the XMI from your original project.
  • Clean up your temporary XMI file, and perhaps your DTD file, and close your EA projects.
  • You're done!

You'll want to fiddle around with the various parameters, as well as figure out when and how EA overwrites existing project nodes. I'll leave that up to you.

Not quite a perfect solution, but it got me through this particular bind when I needed it.

David
No, you can't have it!