Repository navigation
Conversation
|
Hello, Thank your for providing this PR. 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, |
|
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, |
|
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 Please also change the commit message and the changelog. |
f31e7c2 to
0ad70cc
Compare
|
Done |
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>
0ad70cc to
fcc38dc
Compare
Symptom
Exporting a model containing an interface whose ends are feature chains produces invalid SysML v2 text. For the Batmobile template:
Both ends are dropped, and the
InterfaceUsageis exported with theconnectionkeyword.Root cause
PortUsages each own aReferenceSubsettingwhose chainFeature(twoFeatureChainings) is stored only asownedRelatedElement;referencedFeatureis not set.SysMLElementSerializer.appendOwnedReferenceSubsettingreadsgetReferencedFeature()only, getsnulland emits nothing. Such models exist in the wild (templates and projects created before the importer/tools setreferencedFeaturefor owned chains).caseConnectionUsagehard-codesconnectionand is also used forInterfaceUsage, whose keyword is mandatory in the grammar (interface).Fix
appendOwnedReferenceSubsettingresolves the referenced feature through a newresolveReferencedFeature(ReferenceSubsetting)helper:getReferencedFeature()when set, otherwise the owned non-proxyFeaturewith a non-emptyownedFeatureChainingingetOwnedRelatedElement()(which is what KerML requiresreferencedFeatureto be for an owned chain). Rendering is unchanged (appendFeatureChain/ deresolved name).caseConnectionUsagealways emits the keyword for anInterfaceUsage(viaSysMLKeywordSwitch, i.e.interface), and keeps emittingconnectiononly when a plainConnectionUsagehas a declaration, value or body.SysMLKeywordSwitchhas nocaseConnectionUsage, so it is deliberately not used for plain connections.Not changed: the mutation services that build chained ends (
setReferencedFeaturecall sites) were not modified; the exporter now tolerates both shapes, and settingreferencedFeatureat creation time can be addressed separately.Tests
SysMLElementSerializerTest: newinterfaceUsageWithChainedEndsWithoutReferencedFeature(chain only inownedRelatedElement); existingInterfaceUsageexpectations updated fromconnectiontointerface.ImportExportTests: newcheckInterfaceUsageWithChainedEndround trip.CHANGELOG.adocentry added.Closes: #2527
PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW
Auto review
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,type:)Changelog and release notes
CHANGELOG.adoc+doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adocbeen updated to reference the relevant issues?CHANGELOG.adoc?CHANGELOG.adoc?doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Key highlightssection indoc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Documentation
Tests