Book a Demo

Author Topic: model versioning and versions changes (diff)  (Read 5923 times)

moravek

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
model versioning and versions changes (diff)
« on: May 17, 2006, 05:38:44 am »
We are SW development company. The solution we develop we have modelled in EA - use cases, class diagrams, screens. We are in the phase of changes and enhancements, and we have these 2 problems:

1. we have to store/archived versions of model in EA after entering of requirements specified in each Change Request - we don't know how to do it

2. we need to compare 2 stored/archived versions (see previous problem) and to display to our programmers and customers in detail all changes (diff) the analysts/designers made.We have to compare:
- use case diagrams, use-cases and their scenarios, relations (new, changed, deleted),
- class diagrams, classes and their atributes and relations (new, changed, deleted),
- screens - changes in layout and elements (new, changed, deleted).
The result has to be sent to customer to approve all changed and also as a specification for programmers, docummentarists and testers. So we need help how to generate such a "detailed diff" between 2 versions of model and how to generate materials for customers and project team

Thanks in advance

Peter Moravek

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #1 on: May 17, 2006, 05:53:03 am »
Do you use EA baseline models in any way?

What portions of the EA Compare (diff) utility results are insufficient for your needs? I'm asking in order to gain a better understanding of your requirements.
No, you can't have it!

moravek

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #2 on: May 17, 2006, 11:20:06 pm »
We tried to use EA baseline and EA compare utility - but we encountered these problems:

1. you cannot compare 2 baselines - you can only compare 1 baseline vs. current model

2. to create baseline - it lasts too long

3. in result tree - it is difficult to find only changed elements

4. in results - there are not highlighted differences in text attributes (i.e. scenarios, notes) as for example in MS VSS

5. we dont know how to generate document containing only changed elements with displayed/highlighted changes (to send it to our customer for approvement and to use it as specification for programmers/testers/documentarists)

thomaskilian

  • Guest
Re: model versioning and versions changes (diff)
« Reply #3 on: May 18, 2006, 02:28:54 am »
You could make use of an extend search where you specify the modification date to be greater than the beginning of the change period.

moravek

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #4 on: May 18, 2006, 02:32:01 am »
But using extended search to find elements modified after certain time I won't get from the system the changes - diff (that have been made), just the list of changed elements and their current content

thomaskilian

  • Guest
Re: model versioning and versions changes (diff)
« Reply #5 on: May 18, 2006, 02:36:07 am »
I know. You just have the possibility to either compare your current project to a baseline or to use the search. AFAIK you have no other choice. Maybe you feel like writing a add-in to compare two models using the results of a diff on two XML exports? You then just have to find the GUIDs of the passenges being marked as changed.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #6 on: May 18, 2006, 04:33:39 am »
True Thomas, but I think that is closer to the description of Peter's problem than the solution. Keeping track of changes by date also presents the issue of traciking which dates apply to which revisions, which would somehow have to be done outside of the system. One would want the system to be able to do this somehow. But that would seem to be a function of a difference tracking utility, and we're back into the loop.

I think, at least for now, the EA diff funtion is not going to solve Peter's problem. It might be possible to extract XMI from both the model and the baseline, perhaps via a small add-in or external automation program. The two streams could then be compared with a third-party diff utility and results presented or massaged. This last step might also be done through an external automation routine, perhaps the same one that pulled the XMI streams.

Certainly a bit of work, and I don't offhand know of a diff library that would do this quickly. Still, there must be several of these around at nominal or no cost, and the programming does not sound too daunting.
No, you can't have it!

moravek

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #7 on: May 19, 2006, 12:45:44 am »
Yesterday evening I was thinking of the solution. And I think I have found one (maybe a bit complicated - please comment):

step 1. TIME1 - export current model from server DB to XMI as TIME1.xmi
step 2. TIME2 - export current model from server DB to XMI as TIME2.xmi
step 3. run external diff (onto TIME1.xmi vs. TIME2.xmi) to find new/changed/removed elements/diagrams
step 4. open TIME1.xmi as local EA model - generate RTF report/docummentation with content only of changed and removed elements/diagrams -> TIME1.rtf
step 5. open TIME2.xmi as local EA model - generate RTF report with content only of changed and removed elements/diagrams -> TIME2.rtf
step 6. run MS Office Word - open TIME1.rtf and use "Tools > Compare and Merge Documents ..." to highlight all changes in detail -> save as TIME2vsTIME1.rtf

If you think that this steps are OK, please help me to find the way how to automate them. My suggestions:

steps 1+2 - I do not know whether it is possible to run EA from command-line with command to open model and to export it to XMI. I have no experience with programming/scripting EA - do you have any suggestions how to do it ?

step 3 - there are many ways:
 1. use XSLT to compare 2 XML fragments - using the <UML:TaggedValue tag="date_modified" /> element in saved XMIs
 2. use one of these XML diff utilities - http://www.manageability.org/blog/stuff/open-source-xml-diff-in-java/view

step 4+5 - as in 1+2 - I am unexperienced in programming/scripting EA - can you help me to find a way how to automatically open XMI in local EA model and generate specific report (by template and defined list of elements) ?

step 6. I think it is possible to write a macro and to open MS Word from command line and force it to run defined macro

Thanks a lot for your following responses/suggestions.

Peter

StefanPears

  • EA User
  • **
  • Posts: 119
  • Karma: +6/-0
  • Unwissenheit schützt vor Erkenntnis nicht
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #8 on: May 19, 2006, 01:30:32 am »
Hi Peter,

     steps 1+2 - I do not know whether.......

This is my script to export the root-packages to XMI. I run it with VB2005 Express edition. If you don't have it, get it for free from Microsoft. You must create a window with a Listbox named "List1" to run it.

Sorry, I haven'd had the time to translate my comments and names into english and to clean up my companies stuff and my private stuff. Just ask me if you encounter any problems.

It picks up parameters from the environment to open the given Oracle database, but you'll find commented areas as well, where you can fill in the parameters of your local EAP-file. The script creates one or more XML-files named like <toplevel-package-name><date><time>.XML.

I hope someone can add information to the other steps.

Stefan

Option Strict Off
Option Explicit On
Friend Class XML_Export

Inherits System.Windows.Forms.Form

Dim m_Repository As EA.Repository

Dim package As EA.Package

Dim m_project As EA.Project

Dim pw, pfad, filePath, dateiName, user, datei As String

Dim j As Short
   Sub main_Renamed()
       'Datenbank-Repository öffnen, XML-Dateinamen festlegen aus Umgebungsvariablen
       filePath = Environ("BLWDB_filePath")
       user = Environ("BLWDB_user")
       pw = Environ("BLWDB_pw")
       dateiName = Environ("BLWDB_dateiName")
       pfad = Environ("BLWDB_pfad")
       If filePath = "" Or user = "" Or dateiName = "" Or pfad = "" Then
           ListAdd("Repository --- Umgebungsvariable nicht gefunden")
           ListAdd("BLWDB_filePath = " & filePath)
           ListAdd("BLWDB_user = " & user)
           ListAdd("BLWDB_pw = " & pw)
           ListAdd("BLWDB_dateiName = " & dateiName)
           ListAdd("BLWDB_pfad = " & pfad)
           GoTo fehler
       End If

       '    'MasterModel-Repository öffnen, XML-Dateinamen festlegen
       '    filePath$ = "MasterModel --- DBType=3;Connect=Provider=OraOLEDB.Oracle.1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=xxx.xxx.de"
       '    user$ = "your name"
       '    pw$ = "your secret PW"
       '    dateiName$ = "MasterModel"
       '    pfad$ = "C:\xxx"

       'lokales Repository öffnen
       '    filePath$ = "C:\xxx\xxx_lokal.EAP"
       '    user$ = ""
       '    pw$ = ""
       '    dateiName$ = "xxx_lokal"
       '    pfad$ = "C:\xxx\"

       ListAdd(("***** XML_Exportieren (Version 1.02 ******"))
       '    ListAdd ("Optionen: " + Command$)
       ListAdd(("Öffne Repository: " & filePath) & " am " & Format(Now(), "short Date") & " " & TimeString)
       m_Repository = New EA.Repository
       If user = "" Then
           If Not m_Repository.OpenFile(filePath) Then
               ListAdd("Repository Open failed")
               GoTo fehler
           End If
       Else
           If Not m_Repository.OpenFile2(filePath, user, pw) Then
               ListAdd("Repository Open failed")
               GoTo fehler
           End If
       End If
       For j = 0 To m_Repository.Models.Count - 1
           'datei = CStr(CDbl(pfad & dateiName & "_" & jjmmtt_hhmmss() & "_") + m_Repository.Models.GetAt(j).Name + CDbl(".xml"))
           datei = pfad & dateiName & "_" & jjmmtt_hhmmss() & "_" + m_Repository.Models.GetAt(j).Name + ".xml"
           ListAdd("XML-Export läuft für: " & " " + m_Repository.Models.GetAt(j).Name)
           'ListAdd(" Zeit: " & Str(Today.ToOADate) & " " & Str(TimeOfDay.ToOADate))
           ListAdd(" Zeit: " & Format(Now(), "short Date") & " " & TimeString)
           ListAdd(" Datei: " & datei)
           '                                                   bei Mastermodell: 0 = Spielwiese
           '                                                                     1 = BLW Konzeptionelles Modell
           m_Repository.GetProjectInterface.ExportPackageXMI(m_Repository.Models.GetAt(j).PackageGUID, EA.EnumXMIType.xmiEA11, 1, 0, 1, 1, datei)
       Next j
       m_Repository.CloseFile()
       ListAdd("Fertig!" & Format(Now(), "short Date") & " " & TimeString)
       Me.Close()
       GoTo ende
fehler:
       ListAdd("FEHLER! " & Format(Now(), "short Date") & " " & TimeString)
ende:
   End Sub

Sub ListAdd(ByRef sString As String)


'    Text1.Text = Text1.Text + " / " + sString$


List1.Items.Add((sString))

End Sub

Private Sub XML_Export_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load


Me.Show()


main_Renamed()

End Sub

Private Function jjmmtt_hhmmss() As String


jjmmtt_hhmmss = Mid(Format(Now(), "short Date"), 7, 4) & Mid(Format(Now(), "short Date"), 4, 2) & Mid(Format(Now(), "short Date"), 1, 2) & "_" & Mid(TimeString, 1, 2) & Mid(TimeString, 4, 2) & Mid(TimeString, 7, 2)
   End Function
End Class

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: model versioning and versions changes (diff)
« Reply #9 on: May 19, 2006, 06:44:04 am »
If you feel creative you can write something similar in VBA and run it from within Word. This can do the work of creating an EA instance and exporting the XMI, so you don't have to switch back and forth.

It involves some hair-pulling, but I've did something similar back in the EA 4.1 days in order to provide documentation features that EA could not. The client did not have a development process or environment available, but VBA within Word did the trick nicely.
No, you can't have it!