Sparx Systems Forum
Enterprise Architect => Bugs and Issues => Topic started by: zaknixon on April 18, 2008, 12:05:49 am
-
I have been trying to synchronize my current set of source with the models. I have been unable to do so since EA does not do anything when I press Code Services > Synchronize with Code.
Maybe it is something with my setup, which if so, would like some guidance on how to correctly set up my VS project to work correctly with the code synch (without having to reverse my code into diagrams).
Any help on this would be much appreciated.
-
Okay, it sounds like you're running from visual studio integration.
The Synchronize with Code command should be updating your model with changes in the code. What are you seeing? What are you expecting to see?
-
Note: I am running with MDG VS Integration.
Let's say I build a new class in the UML model. Define some methods, and generate the code in package/folder X. Now, I notice that the source location is incorrect, so I move it to its correct location. Now I make changes in the code/model and want to synchronize. Nothing occurs.
-
Check FileName in Properties window in EA and update it accordingly. EA doesn't know you moved the file so it tries to synchronize with the last one. You probably have a nice unmodified copy of a file at its previous location.
Regards
Ged
-
Changing the file location is the bit of information I was missing and Ged was exactly right about the solution.
I'll just add that 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.
-
The solution that Ged recommended does not solve my issue. I updated the file location and performed a code sync, which did nothing.
-
Also, sometimes if I select an element, say "View Code", it goes to the correct source, but the element may be out of sync. I perform a "Synchronize" and the element does not change. Any solutions ?
-
Note: I noticed if I have the following structure in my UML
Class Model
|
--- src
|
-----Com
|
-----MyElement
And I link it to a VS project, whenever I generate the code, it goes in a folder called Class Model\src\Com\MyElement.cs. How do I instruct a particular package to be placed in the correct place in a VS project ?
(BTW: I only added the src level in my UML to see if it correctly sync'ed , which it did not)