Book a Demo

Author Topic: Re-syncing models with code after directory change  (Read 3286 times)

EricP

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re-syncing models with code after directory change
« on: January 04, 2010, 12:12:12 pm »

Using EA 7.5.850...

I have a set of classes from which I have generated code into a specific directory.

Now I want to change the directory tree, so the source files will be in a different directory.  I find that I cannot resync the models with the code if the code is in a directory other than the directory into which it was originally generated.

I find that the only way I can resync the models with the code is to move the code to a temporary directory, then regenerate the code into the directory I want, copy the saved code back over the code just generated, and then resync with the models.

With 48 classes that is, shall we say, somewhat inconvenient...

Is there another way to handle the case where the directory tree has changed?


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Re-syncing models with code after directory ch
« Reply #1 on: January 04, 2010, 01:59:14 pm »
EA is not updating the existing class because they has a different filename from those being imported.
 
In order to get EA to update the existing classes you will need to update the filename of each class.  This can be done using the dockable properties window.  (View | Properties)
 
A bulk update of class filenames when a directory path has changed can be made using local paths (See http://www.sparxsystems.com.au/EAUserGuide/index.html?localpaths.htm) as follows.
 
Open the local paths dialog. (Settings | Local Paths) In the path field enter the path that EA currently thinks your files are at, or part of it.
In the ID field enter something like "Source_Path".
In the type field select your source code language.
Click "Apply Path"
This will substitute the path you entered for the ID in all classes containing that path.
Edit the path field to your new path.
EA will now find the files in their new paths.
If you want to you can now click "Expand Path" and then delete that path.
That will remove the relative paths that were created before, setting them back to absolute paths.