Skip to content

[2419] Export the metadata of the ends of a connector declared inline - #2420

Merged
AxelRICHARD merged 1 commit into
eclipse-syson:mainfrom
kkkk1258999:kab/fix/connector-end-metadata-export
Aug 14, 2026
Merged

[2419] Export the metadata of the ends of a connector declared inline#2420
AxelRICHARD merged 1 commit into
eclipse-syson:mainfrom
kkkk1258999:kab/fix/connector-end-metadata-export

Conversation

@kkkk1258999

@kkkk1258999 kkkk1258999 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW

Auto review

  • Have you reviewed this PR? Please do a first quick review, It is very useful to detect typos and missing copyrights, check comments, check your code... The reviewer will thank you for that :)

Project management

  • Has the pull request been added to the relevant milestone?
  • Have the priority: and pr: labels been added to the pull request? (In case of doubt, start with the labels priority: low and pr: to review later)
  • Have the relevant issues been added to the pull request?
  • Have the relevant labels been added to the issues? (area:, type:)
  • Have the relevant issues been added to the same project milestone as the pull request?

Changelog and release notes

  • Has the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc been updated to reference the relevant issues?
  • Have the relevant API breaks been described in the CHANGELOG.adoc?
  • Are the new / upgraded dependencies mentioned in the relevant section of the CHANGELOG.adoc?
  • In case of a change with a visual impact, are there any screenshots in the doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a key change, has the change been added to Key highlights section in doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?

Documentation

  • Have you included an update of the documentation in your pull request? Please ask yourself if an update (installation manual, user manual, developer manual...) is needed and add one accordingly.

Tests

  • Is the code properly tested? Any pull request (fix, enhancement or new feature) should come with a test (or several). It could be unit tests, integration tests or cypress tests depending on the context. Only doc and releng pull request do not need for tests.

Sorry about the removed template, it is restored above.

The unchecked boxes of the Project management section are the ones I have no
permission for: the milestone and the labels, on this pull request and on the
issue. Could someone from the team set them? The remaining unchecked boxes do
not apply here: there is no API break, no dependency change, and no visual
impact since this only changes the exported text.

Fixes #2419

Problem

The prefix metadata carried by the ends of a connector are dropped by the
export when those ends are owned through an EndFeatureMembership, which is
the shape produced by every connector created from a diagram.

appendConnectorEnd writes the multiplicity, the declared name and the
reference subsetting of an end, but not its prefix metadata, although
appendExtensionKeyword is already used for that purpose elsewhere, on the
connector itself for instance.

This went unnoticed because a connector whose ends are owned through a plain
FeatureMembership, which is what the textual import produces, does not go
through appendConnectorEnd at all: appendConnectorPart finds no
EndFeatureMembership, the ends are left out of childrenMembershipToSkip,
and they end up serialized as regular children, metadata included. Only the
inline form loses them.

Concretely, a requirement derivation created from a diagram exported as

#DerivationMetadata connect P::original to P::derived;

losing the #original and #derive of its ends, so which requirement is the
original one and which one is derived was no longer stated in the exported
text. Importing that text back gives a derivation whose direction can only be
guessed from the declaration order of its ends.

Fix

Call the existing appendExtensionKeyword on the end at the beginning of
appendConnectorEnd. The same derivation now exports as

#DerivationMetadata connect #OriginalRequirementMetadata P::original to #DerivedRequirementMetadata P::derived;

Tests

SysMLElementSerializerTest.connectionUsageWithMetadataOnItsEnds serializes a
connection whose two ends are owned through an EndFeatureMembership and carry
a prefix metadata each, and checks that both are exported:

connection interface1 connect #original socket to #derive outlet;

The 123 existing tests of SysMLElementSerializerTest and the 47 tests of
ImportExportTests still pass, so the round trip of the connections whose ends
come from the textual import is unaffected.

Notes

I found this while preparing the edge tool creating a requirement derivation
from the General View, requested in #2413: a derivation created from the
diagram would have exported without its direction. The problem is not specific
to derivations though, it affects the metadata of any inline connector end,
which is why it is fixed separately, before that tool.

There are no changed or removed lines, only additions.

@AxelRICHARD

Copy link
Copy Markdown
Member

@kkkk1258999 thank you for this PR, I will look at it.

Please do not remove the PR template. Instead you must fill the appropriate checkboxes.

Regards,

The prefix metadata carried by the ends of a connector were dropped by
the
export when those ends are owned through an EndFeatureMembership, which
is the
shape produced by every connector created from a diagram.

appendConnectorEnd wrote the multiplicity, the declared name and the
reference
subsetting of an end, but not its prefix metadata, although
appendExtensionKeyword
is already used for that purpose elsewhere, on the connector itself for
instance. Calling it on the end as well restores them.

This went unnoticed because a connector whose ends are owned through a
plain
FeatureMembership, which is what the textual import produces, does not
go
through appendConnectorEnd at all: appendConnectorPart finds no
EndFeatureMembership, the ends are left out of childrenMembershipToSkip,
and
they end up serialized as regular children, metadata included. Only the
inline
form lost them.

Concretely, a requirement derivation created from a diagram exported as

losing the #original and #derive of its ends, so which requirement is
the
original one and which one is derived was no longer stated in the
exported
text.

Bug: eclipse-syson#2419
Signed-off-by: kkkk1258999 <fishing_kaba@yahoo.co.jp>
@AxelRICHARD
AxelRICHARD force-pushed the kab/fix/connector-end-metadata-export branch from 1be3def to 464a676 Compare August 14, 2026 13:29
@AxelRICHARD
AxelRICHARD merged commit ef08991 into eclipse-syson:main Aug 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[textual export] The metadata of a connector end declared inline is dropped by the export

2 participants