Enterprise Architect: how to synchronize with source code (source -> model) when its in a different absolute path in the disc?
Asked Answered
A

2

10

I've made a model in Enterprise Architect using the 'reverse engineering' tool to import my Java classes into the EA model. Now I intend to keep this model up-to-date with the code as the development goes on.

The thing is: when I try to synchronize the code within the model (source -> model) it only works if the source code is still in the same absolute path it was in the disc when I first imported. But if I change the source code's location on the disc, it duplicates my classes.

That is a huge problem considering that every developer has it's own folder structure. It can get worst when it comes to different operational systems (which is my case).

Example:

Location of the source code when it was imported:

/Volumes/Data/Projects/xxx_project/src/...

Location of the source code when it has to be synchronized by another developer:

C:\projects\xxx_project\src\...

Does anybody know how to use a "relative path" to the source code, or to change the binding of the source code's location on the model?

Abdias answered 11/2, 2011 at 22:47 Comment(1)
Hmm, at the moment I have exactly the same problem and searching for a solution too... did you find out anythin helpful in the meantime?Greywacke
G
14

The version I use is 8.0.860

The solution is to use a feature called "Locale Paths" in EA. You find it in the menue item Settings-->Locale Paths... It opens a dialog box that enables you to replace local paths in the model with an ID and vice versa. With this feature it is possible to replace a present path in the model with another one. It also gives you the possibility to use the model on different machines with different local paths.

To find out to which local path a given class in the model was bound I grepped the binary file of the model. Then I replaced the path name with the buttons ApplyPath and ExpandPath. To me it seemed that the changes in the model concerning the path take effect not until closing EA and restarting it again.

After that it was possible to see the source code of a class by right clicking the class and executing "View source code..." at the new location on the disk.

Greywacke answered 7/3, 2011 at 10:22 Comment(4)
Haven't tested yet, but I figure this solves the issue. Thanks!Abdias
Won't help when importing binary files.Estes
Perfect, worked for me even with latest 13.x version of EA.Hernando
Two useful Sparx resources for v13: Local Paths and Local Paths Dialog.Stepparent
C
4

I'm using version 9.0

The solution here:

  • On the class diagram, choose "Generate code..." (F11)
  • Select the new class file location as Path
  • Save

And the binding should be fixed.

Carlisle answered 7/3, 2012 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.