osate / osate-ge

Old Graphical editor for OSATE repository, kept for reference
6 stars 3 forks source link

Diagram files are stored in wrong project if same package names are used #130

Closed lwrage closed 8 years ago

lwrage commented 8 years ago

I have 2 new projets (test and xyz) and in each project I have a package named test. The contents of the packages are different. When editing the package diagrams (or other diagrams) there is only a single diagram file created even though the two packages are different.

snapshot1

philip-alldredge commented 8 years ago

This is something that is currently being worked. The root cause is that the method for looking up the AADL element is not considering the project the diagram is in. It is also not considering project references. This issue should be fixed when the element lookup rework is finished.

philip-alldredge commented 8 years ago

The referencing mechanism is currently be reworked. The issue is that the graphical editor needs to resolve references to an element in the declarative model. This is currently uses the EMF Index.

The plan is to replace this approach with one that will use the qualified name in conjunction with the project references to find an AADL package based on the qualified name. Once the package is retrieve, the model element will be returned from the package. However, due to differences in how Xtext needs to resolve references and how the graphical editor needs to resolve them, there may be some cases where the results are not the same.

Specially, Xtext project references are not transitive. That is, if Project A references Project B and Project B references Project C, project A cannot reference a package in Project C. However, to support nesting diagrams, a diagram in Project A must be able to reference an element in Project C. Personally, I consider this an edge case and will consider it a known issue unless it causes a problem for users. In the above case, it would cause an issue only if Project A and Project C contained packages with the same name. If Project B contained a conflicting name, the OSATE would report an error.

philip-alldredge commented 8 years ago

Fixed in b5111d219bda99eea88403aa72efd101b989561e .

philip-alldredge commented 8 years ago

Reopening. There is a critical issue where references aren't being resolved properly.