Skip to content

[2527] Export chained connector ends and the interface keyword - #2531

Closed
HuiJun wants to merge 2 commits into
eclipse-syson:mainfrom
Open-MBEE:fix/connector-end-feature-chain
Closed

HuiJun wants to merge 2 commits into
eclipse-syson:mainfrom
Open-MBEE:fix/connector-end-feature-chain

Conversation

@HuiJun

@HuiJun HuiJun commented Sep 22, 2026 •

Copy link
Copy Markdown

Symptom

Exporting a model containing an interface whose ends are feature chains produces invalid SysML v2 text. For the Batmobile template:

// reference
interface bat2eng : PowerInterface connect battery.powerPort to batmobileEngine.enginePort;
// exported
connection bat2eng : PowerInterface connect  to ;

Both ends are dropped, and the InterfaceUsage is exported with the connection keyword.

Root cause

  • The two end PortUsages each own a ReferenceSubsetting whose chain Feature (two FeatureChainings) is stored only as ownedRelatedElement; referencedFeature is not set. SysMLElementSerializer.appendOwnedReferenceSubsetting reads getReferencedFeature() only, gets null and emits nothing. Such models exist in the wild (templates and projects created before the importer/tools set referencedFeature for owned chains).
  • caseConnectionUsage hard-codes connection and is also used for InterfaceUsage, whose keyword is mandatory in the grammar (interface).

Fix

  • appendOwnedReferenceSubsetting resolves the referenced feature through a new resolveReferencedFeature(ReferenceSubsetting) helper: getReferencedFeature() when set, otherwise the owned non-proxy Feature with a non-empty ownedFeatureChaining in getOwnedRelatedElement() (which is what KerML requires referencedFeature to be for an owned chain). Rendering is unchanged (appendFeatureChain / deresolved name).
  • caseConnectionUsage always emits the keyword for an InterfaceUsage (via SysMLKeywordSwitch, i.e. interface), and keeps emitting connection only when a plain ConnectionUsage has a declaration, value or body. SysMLKeywordSwitch has no caseConnectionUsage, so it is deliberately not used for plain connections.

Not changed: the mutation services that build chained ends (setReferencedFeature call sites) were not modified; the exporter now tolerates both shapes, and setting referencedFeature at creation time can be addressed separately.

Tests

  • SysMLElementSerializerTest: new interfaceUsageWithChainedEndsWithoutReferencedFeature (chain only in ownedRelatedElement); existing InterfaceUsage expectations updated from connection to interface.
  • ImportExportTests: new checkInterfaceUsageWithChainedEnd round trip.
  • CHANGELOG.adoc entry added.

Closes: #2527

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.

@HuiJun HuiJun changed the title Fix/connector end feature chain Export chained connector ends and the interface keyword Sep 22, 2026
@AxelRICHARD AxelRICHARD added this to the 2026.11.0 milestone Sep 22, 2026
@AxelRICHARD

AxelRICHARD commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Hello,

Thank your for providing this PR.
Could you also sign the Eclipse Contributor Agreement (ECA) https://www.eclipse.org/legal/eca/ please ? I won't be able to merge the PR if you don't sign it, because SysON is a project of the Eclipse Foundation.

If this PR is related to #2264 and #2275 as it seems to be (you mentioned them in the changelog), it means that the original issues must be re-opened first, then you will have to explain why on those issues.

Then I will perform a review.

Thank you for your understanding.

Regards,

@HuiJun

HuiJun commented Sep 23, 2026

Copy link
Copy Markdown
Author

Hi Axel! Sorry for the delay, but I'm actually contributing to open source according to my organization's approval, and if we get into any kind of legal review situation, it's just going to drag this on forever. I think at this point, maybe the fastest thing to do would be to disown any of the code in this PR, and let you do whatever you wish with it. We'd really like to see this get it, but let me know if we're going to have to take the long route. Thank you.

@AxelRICHARD

Copy link
Copy Markdown
Member

Hi Axel! Sorry for the delay, but I'm actually contributing to open source according to my organization's approval, and if we get into any kind of legal review situation, it's just going to drag this on forever. I think at this point, maybe the fastest thing to do would be to disown any of the code in this PR, and let you do whatever you wish with it. We'd really like to see this get it, but let me know if we're going to have to take the long route. Thank you.

Hello,
Here is my proposal: please take into account all my remarks except the one about the ECA.
When the PR will be ok, I will close it and reopen a new one in my own name, with your consent.
Is it ok for you?
Regards,

@HuiJun

HuiJun commented Sep 23, 2026 •

Copy link
Copy Markdown
Author

As for closing and re-opening, absolutely no issues with that whatsoever. Sorry for the confusion about the related issue and pr. #2264 reported the same symptom (connection interface1 connect to ;) for an interface created in the diagram editor, and was fixed and closed by PR #2275 (merged July, commit 288a060). That fix handles ends whose ReferenceSubsetting.referencedFeature is set.

I've updated to PR to only reference the open issue for which this PR is targeting. Otherwise, this PR should be ready for review.

@HuiJun HuiJun changed the title Export chained connector ends and the interface keyword [2527] Export chained connector ends and the interface keyword Sep 23, 2026
@AxelRICHARD AxelRICHARD changed the title [2527] Export chained connector ends and the interface keyword [2264] Export chained connector ends and the interface keyword Sep 23, 2026
@AxelRICHARD AxelRICHARD changed the title [2264] Export chained connector ends and the interface keyword [2527] Export chained connector ends and the interface keyword Sep 23, 2026
@AxelRICHARD

Copy link
Copy Markdown
Member

@HuiJun Please also change the commit message and the changelog.

@AxelRICHARD
AxelRICHARD self-requested a review September 23, 2026 13:50
@devin-ai-integration
devin-ai-integration Bot force-pushed the fix/connector-end-feature-chain branch from f31e7c2 to 0ad70cc Compare September 23, 2026 14:02
@HuiJun

HuiJun commented Sep 23, 2026

Copy link
Copy Markdown
Author

Done

HuiJun and others added 2 commits September 23, 2026 14:10
Models created before the importer set referencedFeature for owned chains only store the chain as ownedRelatedElement of the ReferenceSubsetting; resolve the referenced feature from there as a fallback. InterfaceUsage must be exported with the interface keyword, which is mandatory in the grammar.

Bug: eclipse-syson#2527
Signed-off-by: Jason Han <jason.han@jpl.nasa.gov>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Bug: eclipse-syson#2527
Signed-off-by: Jason Han <jason.han@jpl.nasa.gov>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the fix/connector-end-feature-chain branch from 0ad70cc to fcc38dc Compare September 23, 2026 14:10
@AxelRICHARD

Copy link
Copy Markdown
Member

Close this pull request, it has been replaced by #2545
@HuiJun thank you!

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 drops chained connector ends (connect to ;)

2 participants