Book a Demo

Author Topic: Load a package baseline from an addin  (Read 5027 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Load a package baseline from an addin
« on: April 11, 2017, 06:48:32 am »
Hi,

I have a package baseline GUID and the associated EA.Package in my addin class.
I checked how the information is stored in the DB as a zip base64 coded content from previous post.

However it doesn't seem to be possible from Sparx EA API or SQL queries to load the XMI content e.g. via an XMI import?

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: Load a package baseline from an addin
« Reply #1 on: April 11, 2017, 06:59:32 am »
Check DoBaselineMerge from http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/automation_and_scripting/project_2.html. There are a couple of baseline manipulation operations.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Load a package baseline from an addin
« Reply #2 on: April 11, 2017, 05:21:16 pm »
Hi Guillaume,

Nope. You can create baselines, merge baselines, delete baselines, compare packages with baselines -- but you can't import or export baselines. What you need to do is reverse-engineer the baseline format, then create a file with properly formatted content from your package, compress that in the correct compression format and then store it in t_documents using an insert SQL statement.

And the reverse to export it, of course.

/Uffe
My theories are always correct, just apply them to the right reality.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Load a package baseline from an addin
« Reply #3 on: April 12, 2017, 07:19:48 am »
Hi,

In C#, I run the following           
eaproj.DoBaselineMerge(packageGUID, packageBaselineGUID, "<Merge><MergeItem guid=\"RestoreAll\" changed=\"true\" baselineOnly=\"true\" modelOnly=\"true\" moved=\"true\" fullRestore=\"true\" /></Merge>", null);

It works but I get the following error: the currently selected package doesn't exist in the comparing document.

The odd thing is that packageGUID matches the Package against which the baseline was created.

Any clue?

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: Load a package baseline from an addin
« Reply #4 on: April 12, 2017, 07:37:01 am »
You might need to transform the GUID with the ProjectInterface operation GUIDtoXML.

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Load a package baseline from an addin
« Reply #5 on: April 12, 2017, 05:31:21 pm »
It fixed it, thanks !  :)

Guillaume

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