Conversation
|
Hello, Thank your for providing this PR. If this PR is related to #2429 as it seems to be, please add a comment on this issue saying that you want to work on this issue. I will affect it to you. Also it seems you added a fix for #2213. Please provide a separate PR for this issue and add a comment on this issue saying that you want to work on this issue. I will affect it to you. Then I will perform a review. Thank you for your understanding. Regards, |
f7ccd69 to
81b0aa8
Compare
280f79e to
948d2c9
Compare
|
Hello @HuiJun, Here is my review:
Thank you! |
81cd00c to
d47e340
Compare
A succession whose second end is implicit is now exported by inlining the following member after then, matching the then shorthand. When the succession has an explicit first source or owns body content, the following member is referenced by name instead, and an unnamed member gets a unique generated name in the exported text only. An unnamed composite DecisionNode is now exported as decide; without a trailing space. Bug: eclipse-syson#2528 Signed-off-by: Jason Han <jason.han@jpl.nasa.gov>
d47e340 to
aef7e87
Compare
|
Done! Sorry for the delay in responding! |
Hello @HuiJun, there is no problem, you can take all the time you need for taking into account my remarks et comments. |
Symptom
A succession written with the
thenshorthand and an implicit target (the next body member) is exported as a danglingthen;followed by the target on its own line, which is invalid SysML v2:This is #2528 (Batmobile template export); the same happens in state definitions (
first X then;, the first item of #2429). Additionally an unnamed compositeDecisionNodeis exported asdecide ;(trailing space).Root cause
EndFeatureMembershipowns a bareReferenceUsagewith no (or only implied)ReferenceSubsetting: the target is implicitly the following member.caseSuccessionAsUsagealways emittedthenfollowed byappendConnectorEndMember, which has nothing to emit for such an end. The implicit source case was already handled (isSuccessionUsageImplicitSource), the target case was not.caseDecisionNodeappended"decide "with a hard-coded trailing space before an (empty) declaration.Fix
SysMLElementSerializer:isSuccessionUsageImplicitSourceis generalized toisImplicitEnd(unnamedReferenceUsagewhose specializations are all implied) and used for both ends.getNextMembership/getImplicitSuccessionTarget: when the next not-yet-serialized member of the owning type is anActionUsage(incl. control nodes, states;TransitionUsageexcluded) and the target end is implicit or references exactly that member, the member is serialized inline asthen <member>and added tochildrenMembershipToSkipso it is not emitted a second time. This producesthen decide;,then merge;,then fork;,then join;,then action x {...},then state s2;.then;) and a warning is reported throughreportConsumer.caseDecisionNodeemitsdecideviaappendWithSpaceIfNeededlike the other keywords.Tests
SysMLElementSerializerTest:successionUsageWithImplicitControlNodeTargets(then decide;/then merge;),successionUsageWithImplicitNamedActionTarget(then action a_2;),successionUsageWithImplicitTargetInStateDefinition(then state s2;),successionUsageWithImplicitTargetAndNoFollowingMember(no output + warning),successionUsageWithExplicitSourceAndUnresolvedImplicitTarget(succession omitted instead of a partialfirst a1;),decisionNodeWithoutName.ImportExportTests: newcheckSuccessionWithImplicitTargetsround trip (then decide;,then merge;,then action a3;);checkDecisionWithNamedTransitionand thethen actionexpectation updated to the inline form.CHANGELOG.adocentry added.Fixes #2528. Also fixes the
first X then;item of #2429 (the other items of that issue are not covered). Part of #2213.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