Book a Demo

Author Topic: Export Package-Baseline to another package within the same model or to XMI file  (Read 4329 times)

kai23

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Hi !

I am working on plug-in where I have to restrore a baseline from one package into a different (temporary) package within the same model. When trying via Project.DoBaselineMerge() I always get (among others) the error that the GUIDs are already present in the model - of course they are present in the original package.

How can I restore a baseline to a different package using GUID stripping ?
Also a workaround could be to export the baseline to an XMI file which then could be re-imported. But have not found any way to export a baseline via the automation API.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
I think indeed you'll have to find a workaround with the xmi import from a file.

I think you can rather easily   :-\ export a baseline to a file. IIRC the baselines are simply xmi files stored in t_document. But they are not stored a plain text. They are first zipped and then base64 encoded.
So in order to make an xmi file out of a baseline you use Repository.SQLQuery to get the contents, then base64 decode it, and then unzip it.

Geert