Book a Demo

Author Topic: API Fuction to execute Comparision  (Read 3545 times)

Michael co

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
API Fuction to execute Comparision
« on: December 18, 2013, 12:21:39 am »
How can I use the function {Compare Package with XMI} in Package Controller in EA from >NET ex: C#.
Is there any references to deal with the usage for this function .
how to capture the output and how to read the output to see the differences between the current package of the model with a XML for one baseline...

 


and the other question:
 how could I call and use "Compare Diagram to baseline"
as shown here :




thanks in advance
 

« Last Edit: December 18, 2013, 12:39:27 am by michael17 »

Michael co

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: API Fuction to execute Comparision
« Reply #1 on: December 20, 2013, 10:41:46 pm »
any feed back please

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: API Fuction to execute Comparision
« Reply #2 on: December 20, 2013, 11:03:01 pm »
Hi Michael,

for packages you can use:

Code: [Select]
aProject.DoBaselineCompare(aProject.GUIDtoXML(usepackage.PackageGUID.ToString()), comparebaselineguid, "");
The Guid to compare you may get by :

Code: [Select]
string comparebaselineguid = SBO_enartalis.ENARTalis_main.delxml(Repo.SQLQuery("SELECT DocID FROM `t_document` WHERE `DocType` = 'Baseline' AND DocName='" + usepackage.Name + "' AND Version = '" + usepackage.Version.ToString() + "'"));
The Output is string:

Code: [Select]
if (comparetext.Contains("No Differences Detected"))
                {
                    // do a thing
                }
                else
                {
                    // do another thing
                }


Regards

Stefan
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website