Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
128 stars 24 forks source link

ST6RI-604 Textual package ordering breaks derivation of owner properties #415

Closed seidewitz closed 2 years ago

seidewitz commented 2 years ago

The reported bug happened when an import relationship to a package appeared in a model before the declaration of that package. The graph traversal utility traverses the model graph by following the owned relationships of elements, so, in this case, the package referenced in the import had not yet been processed when the import relationship was processed, and neither had the owning elements of the package. Unfortunately, for historical reasons, the traversal algorithm was only considering elements to have identifiers after they had been processed, which means no IDs were yet available to set the owner (and other owning...) properties of the package, causing the bug.

This pull request updates JsonElementProcessingFacade::getIdentified so that it uses the elementId of an Element, rather than looking up its identifier in the traversal. This means that the ID can be obtained before the Element is processed in the traversal, resolving the bug.