What does your model look like?
Very simple. A few more lines than I already posted (it's just a small test case for some ideas I'm testing).
What changes have you made to the code templates?
None. Just to make sure nothing spooky were lurking in the code templates, I created a new EA model (100% guaranteed untouched code template) and imported and generated, and the same happened again.
But, I noticed something strange with the newly imported model - it had two copies of the class which had the problematic links. That explains it. So I deleted the dupe and generated code, and the sun is shining again.
And no, I had NOT copied that class, at least not consciously. That copy was not visible in the Project Browser on the original model. Only now, when I imported the model into a new EA project, then EA put both copies on a auto-diagram and also showing the two classes in the Project Browser.
Basically, the Code Templates that you can change are in balance with the grammars defined for the importer, which you can't change. If you change the code templates to generate something that doesn't match what the importer sees you will get this behavior.
I honestly don't think so. As long as I have valid C# code (compiling in VS) I have so far not had any problem with EA importing it. Which means that EA knows the grammar, and no matter what kind of code I would generate with a modified template (which compiles in VS), EA seems to pick it up. No connection there.
Or if I put it another way; I do not make templates which produces invalid C# code which neither VS nor EA can handle.
The only ways to prevent it are either to not make those changes or not reverse engineer the model from the code after it's generated.
Hm, that doesn't seem to be irrelevant. What's relevant is that the C# code is valid. Well, so far EA 16.1 has handled import without any problem.
What I have noticed though is that sometimes EA doesn't show what it has in the database. For example the Delphi project I posted about which had some 16.300 .pas files. I had to close EA and start it again before any of the ~20.000 classes would show in the Project Browser. Reminds about this problem where the Project Browser didn't bother show me I had a copy of a class (must have pressed CTRL-C, CTRL-V when not having focus in the right place... or something).
The developers would have reasons to investigate why the UI doesn't always reflect the data...
//Rolf