Book a Demo

Author Topic: Problems with Import Source Directory feature  (Read 3276 times)

Beth

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Problems with Import Source Directory feature
« on: April 24, 2010, 09:39:56 am »
We have an EA project that we keep under source control.  We are trying to use the Code Engineering | Import Source Directory  feature to keep the model updated with the current code at the end of each iteration.  However it seems that only the developer that originally created the EA project can successfully reverse engineer the code.  We I try to update it, all the objects that were in the original model are duplicated.

We have imported our code so the EA project matches our namespace.  As an example, the project contains a package 'src' in the main project.  Under that package we have a package structure that matches our namespace Ims.Efb.Fls.EfbObjectLibrary. In EfbObjectLibrary we have many different objects used by the application.  When I first open the project, there is only one of each class.

Now if I right-click on src and choose the Code Engineering | Import Source Directory option, and import the code from my machine, I will have a single class representing any new objects in the model.  But all the other classes are duplicated.  Here are the options I choose:
Root Directory ==> set to my location of 'src'
Source Type ==> C#
File Extenstions ==> .cs
Recursively Process Subdirectories
Create Logical Diagram
Package Structure ==> Create Package per namespace
Remove classes ==> Prompt for action

For the Synch option, I have tried both the "Synchronize existing classes" and the "Overwrite existing classes" options and they both behave in the same way.

I have also tried the Code Engineering | Synchronize Package Contents option:
Update Type ==> Reverse engineer (source -> model)
Include child packages

This did not duplicate my classes in the model, but it did not import anything new either (in other words, it looked the same as it did prior to running this).

Is there an issue with reverse engineering the code from different machines?  The starting location of the 'src' directory may be different on different machines, but the structure from 'src' down is guaranteed to be the same on every developer's machine.  Since that is the starting location of the import, I would hope that would work.

I am using EA 7.1.833, Database Version 4.01.  This is a C# project.

Thanks,
Beth

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Problems with Import Source Directory feature
« Reply #1 on: April 25, 2010, 09:50:50 pm »
Looks like the source code files are stored in different directories on the respective machines. EA's reverse engineering only matches them when the paths are equal, otherwise it regards them as different sources and produces duplicate classes.

You don't need equal absolute paths on all machines however. Look up http://www.sparxsystems.com/uml_tool_guide/code_engineering/localpaths.htm in the manual, this should solve your problem.

Beth

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Problems with Import Source Directory feature
« Reply #2 on: April 27, 2010, 02:19:51 am »
Perfect - the Local Paths trick did the trick.
Thanks!
Beth