Book a Demo

Author Topic: Compare related models with different GUIDs  (Read 5696 times)

DarrenDickens

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Compare related models with different GUIDs
« on: July 15, 2016, 10:11:11 pm »
I have a script that generates an EA model. If I run it twice I get 2 different models even though the elements within each model are identical. I would like to export each model to separate XML files and compare the 2 XML files to spot differences added by users. Currently I can't compare them since the GUIDs are all different.

I can probably write a tool that will check the XML files and where it can determine that an element is the same in both XMLs the tool could convert the GUID in one XML to the value in the other XML. This should then result in one XML file morphing into the other model. At this point I could use the differencer in EA or my favourite text comparison tool.

Before I start writing this tool does anyone know whether such a tool already exists or whether it is already part of EA (I couldn't find where though).

Thanks
Darren

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Compare related models with different GUIDs
« Reply #1 on: July 15, 2016, 10:23:56 pm »
Hello Darren,
There is not a tool as you have in mind in EA (AFAIK).

The question is what makes the tool assuming that something is the same.
We did something in this direction to find out if our package template is used in a project.
However I do not belief that there is a generic solution on that stuff.
Best regards,

Peter Heintz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Compare related models with different GUIDs
« Reply #2 on: July 15, 2016, 11:20:20 pm »
The question is: why do you generate it twice? If you found a class, make it to be the one. If you generate things, they are new concepts and thus different things.

q.

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Compare related models with different GUIDs
« Reply #3 on: July 15, 2016, 11:33:23 pm »
I assume it is a kind of test result of the generating script.
Best regards,

Peter Heintz

DarrenDickens

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Compare related models with different GUIDs
« Reply #4 on: July 27, 2016, 07:43:37 pm »
Thanks Peter and qwerty for the replies. I've just got back from holidays (fired off the initial question before leaving) hence the delay in replying.

The general consensus is "no there is no tool for what I want". That's OK, I'll have to write my own; I just didn't want to reinvent the wheel.

I'll answer your questions...

I have a script that creates a brand new model based on some source code. When I change the source code I create another model. This is why the GUIDs for the same source code item, e.g. class, become different. I want to compare the 2 models to ensure that only the models areas related to the changed source code are the only parts that actually change.

I thought the XML outputs would be easier to manually verify the changes than relying on the EA model comparison feature. Note, the EA model comparison requires identical GUIDs to compare the actual values related to the GUID.

qwerty - My initial script just created the model; I didn't appreciate the GUID issue when comparing at the end. No my script is complete I don't really want to edit it to keep an "old EA model" to hand, create new item, find it in the EA model and change the GUID in the "new EA model". I thought scanning the resultant XML files and manipulating one of them to match the other would be easier.

If the EA models are similar, i.e. minor source code changes making minor model changes, then the XML layout should be most "in step" with each other so most items will be in the same location in the XML with the same "Name" fields. I appreciate that if they are similar then the same argument could be applied to editing the initial script, but I think I would be more comfortable working on the XML rather than EA properties. Only time will tell which way would have been best.

Thanks
Darren

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Compare related models with different GUIDs
« Reply #5 on: July 27, 2016, 08:47:10 pm »
When you re-create a model (aka synch) you should have means to find back the original. In RR-days long ago, they used to place guids as comment in the code to get the link back. That worked fairly ok, but of course the code looked ugly. And people tinkering with the comments broke the whole stuff. EA tries to match by signature which is probably a better way. The problem here is, when you change the signature, the match will fail. It would be nice to have some flexibility in the match and to allow the user to snap in or break the link while running the RE.

q.