Book a Demo

Author Topic: Diff model from command line?  (Read 8506 times)

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Diff model from command line?
« on: September 02, 2009, 02:15:59 am »
Is there any way to invoke EA from the command line to have it bring up a package diff?

My situation is this: my VCS can invoke a custom command when a merge needs human intervention, passing 3 file names: the file to be merged into, the file to be merged from, and an output file where the merge is expected to be written. Ideally, I'd like to have that invoke EA, load the "to be merged to" file as a package, do a package diff against the "to merge from" file, and then allow the user to manually merge the files, and when done, export the file to the "merged file" and exit with return code of 0.

Is there any way to make that happen?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Diff model from command line?
« Reply #1 on: September 02, 2009, 06:49:43 am »
Off hand I really don't know.

Perhaps you could create a script and add it to your EA start page (or another page). You might then be able to execute the script from a hyperlink on the EA page. In the EA help index look up Save As | Shortcut for some additional advice on setting various startup objects. This works on a per-project basis though, rather than being a 'universal' option that you can pass a project name to.

Other ideas anyone?

David
No, you can't have it!

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Diff model from command line?
« Reply #2 on: September 02, 2009, 04:41:39 pm »
The EA SDK does support Baseline Differnce and merge - best to see:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/project_2.html

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Diff model from command line?
« Reply #3 on: September 02, 2009, 11:21:49 pm »
Yes, but from what that page says it sounds like I would have to have one of my Windows developer write the code to actually do the invocation of EA, load the files, etc.

I was hoping that there might have been a simple set of command line parameters so that I wouldn't have to write a non-trivial program to accomplish this need.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diff model from command line?
« Reply #4 on: September 02, 2009, 11:57:18 pm »
There are no command line parameters AFAIK, but writing a program like this can hardly be called non-trivial.
It should be about two hours work and maybe 20 lines of code. (for an experienced developer)

Geert

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Diff model from command line?
« Reply #5 on: September 04, 2009, 05:37:35 pm »
Yes especially if you use the new internal scripting using JavaScript or VBscript - this will simplify it significanlty.
« Last Edit: September 04, 2009, 05:38:21 pm by Dermot »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diff model from command line?
« Reply #6 on: September 04, 2009, 05:51:25 pm »
Dermot,

Aren't the scripts created by the script editor meant to be executed from within EA?
In that case that would help WowBagger much since he wants to launch it from the checkin/out hooks in his VCS

Geert

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Diff model from command line?
« Reply #7 on: September 05, 2009, 01:12:07 am »
IF I can script EA in Javascript

AND IF I can hook into the right menus

AND IF I can have EA invoke external programs

THEN I might be able to set a Javascript interface to allow EA to manage the VCS - thus making EA "git aware" - and that would meet my needs.

Are there any good guides I could look at?

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Three way merge?
« Reply #8 on: September 09, 2009, 08:11:12 am »
On the same subject, does EA support a three way merge - that is, given 2 different files A and B, and their common ancestor file C, handle merging the 2 files in a meaningful way to yield D, a combination of A and B.

Really, it seems to me that making EA handle proper version control outside of the limited choices built in is very difficult - if you have one developer and are using version control as a "backup" type system it does OK, but if you have multiple people trying to work together and meaningfully manage their changes it seems to fall apart.

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Or even canonicalization?
« Reply #9 on: September 09, 2009, 08:41:44 am »
One of the things that is killing me is that the XMI is not consistent from run to run - entities are output in different orders, attributes (UML, not XML) are put out in whatever order EA seems to feel like, and as a result minor document edits are turned into major differences.

If EA would canonicalize the output - ALWAYS output the XML in a predictable and consistent way - then these merges would be much easier to handle.

This could even be handled by an XSLT after the XMI is generated.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Or even canonicalization?
« Reply #10 on: September 09, 2009, 10:41:54 am »
Quote
One of the things that is killing me is that the XMI is not consistent from run to run - entities are output in different orders, attributes (UML, not XML) are put out in whatever order EA seems to feel like, and as a result minor document edits are turned into major differences.

If EA would canonicalize the output - ALWAYS output the XML in a predictable and consistent way - then these merges would be much easier to handle.

This could even be handled by an XSLT after the XMI is generated.
This should be a familiar request...

Funnily enough, users expect that if they do the same thing twice and nothing changed in the interim, that they get the same result...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Diff model from command line?
« Reply #11 on: September 09, 2009, 04:48:47 pm »
EA does supports Baseline Difference and Merge, so an altered  copy or "Branch model" can be merged back into the main model, internaly without using Version Control. For information on this see "Load Other Baseline" under manage baselines accessible from: http://www.sparxsystems.com/uml_tool_guide/uml_model_management/baselines.html

In terms of SDK usage of this see:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/project_2.html

Please do keep the flow of information for a single entry. If you have another topic/subject please create another entry on the forum for this.
« Last Edit: September 09, 2009, 04:50:49 pm by Dermot »

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Diff model from command line?
« Reply #12 on: September 09, 2009, 11:26:32 pm »
I consider all of this the same thing - I am trying to deal with the fact that I cannot make EA play nice with a version control system that supports the concept of multiple branches with different development going on in each branch.

My project is at a standstill due to this - I *need* to have multiple programmer/analysts working on different aspects and be able to pull their work together, to hit my schedules. However, I have found the EA diff tool to be very unhelpful in actually merging changes like this, as I don't feel the way the data is presented allows me to meaningfully identify what are real changes, and what are noise - when I do a diff I get items being marked as different that, when I inspect them, are not visibly different. EA doesn't handle three way merges at all, so merging the divergent work of multiple analysts into a coherent whole is VERY difficult.

It seems to me that the design model of EA primarily supports a linear model of code evolution - not a branched version. Perhaps that is different with a VCS that EA knows how to talk to.