Book a Demo

Author Topic: DoBaselineCompare not working  (Read 4032 times)

umarkhan

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
DoBaselineCompare not working
« on: May 15, 2018, 09:13:27 pm »
Hi everyone,

I am exploring the baseline comparison options in the enterprise architect. Just for testing purposes, I baselined a package, then made some changes in it (like adding new sub-packages and elements). When I run the baseline compare from EA, it works fine. But when I try to do the same with scripting, it shows me "No differences". I can't seem to figure out the problem. My test code is here:

Code: [Select]

import win32com.client

def main():

    eaApp = win32com.client.Dispatch("EA.App")
    eaRep = eaApp.Repository
    eaProj = eaRep.GetProjectInterface()

    pkg_xml_guid = eaProj.GUIDtoXML('{8E45087F-E6E7-447d-8D72-43DBEB8A0F85}')
    pkg_baseline = eaProj.GetBaselines(pkg_xml_guid, 0)
    baseline_compare = eaProj.DoBaselineCompare(pkg_xml_guid, pkg_baseline, 0)
    print baseline_compare

if __name__ == '__main__':
    main()

The result is:

<?xml version="1.0" encoding="UTF-16"?>
<EA.CompareLog status="No Differences Detected" comparedOn=""/>

I will highly appreciate any help regarding this. Thanks

Kind Regards
Umar

Arshad

  • EA User
  • **
  • Posts: 291
  • Karma: +21/-1
    • View Profile
Re: DoBaselineCompare not working
« Reply #1 on: May 15, 2018, 09:41:32 pm »
Hi umarkhan
  • The second parameter for the DoBaseline method should be also the GUID value in xml format. Its the GUID of that baseline which is stored in t_document table.
    Columns :
    Doc ID - is the baseline GUID and
    ElementID  - is the package GUID
  • Please mention your eap path in the as the third parameter ( even though its optional )
Code: [Select]
var pro as EA.Project;
       pro =Repository.GetProjectInterface();
         var baseline = pro.GetBaselines("EAID_A347217F_E498_4601_B7D7_FAFE5B48B515","")
var changes = pro.DoBaselineCompare("EAID_A347217F_E498_4601_B7D7_FAFE5B48B515","EAID_26E0D3C7_9830_4f8a_B08A_F8DEF40E4D3D","C:\Users\Delete\Test.eap");



I just tried the above jscript code and its working for me.


HTH
Arshad
« Last Edit: May 15, 2018, 09:43:59 pm by Arshad »

umarkhan

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: DoBaselineCompare not working
« Reply #2 on: May 15, 2018, 09:59:13 pm »
Hi Arshad,

It worked like a charm. Thank you very much :)

Arshad

  • EA User
  • **
  • Posts: 291
  • Karma: +21/-1
    • View Profile
Re: DoBaselineCompare not working
« Reply #3 on: May 15, 2018, 10:00:35 pm »
Hi Arshad,

It worked like a charm. Thank you very much :)

Glad it worked  :D


Arshad