From 4c05436617cf7d9a37dc4b32905eaacfed8442ce Mon Sep 17 00:00:00 2001 From: Axel RICHARD Date: Thu, 18 Sep 2025 10:33:36 +0200 Subject: [PATCH] [1530] Add RequirementUsage's ReqId to the Details View Core tab Bug: https://github.com/eclipse-syson/syson/issues/1530 Signed-off-by: Axel RICHARD --- CHANGELOG.adoc | 1 + .../syson/application/services/CoreFeaturesSwitch.java | 9 +++++++++ .../application/services/DetailsViewServiceTest.java | 10 ++++++++++ .../user-manual/pages/release-notes/2025.10.0.adoc | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 85564600b..0562eeb79 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -82,6 +82,7 @@ Consumers may override this by providing an implementation of `org.eclipse.syson - https://github.com/eclipse-syson/syson/issues/1502[#1502] [libraries] Update standard libraries to SysMLv2 2025-07 specification. - https://github.com/eclipse-syson/syson/issues/1432[#1432] [metamodel] Add implicit `Subclassification` or `Subsetting` when using semantic `MetadataUsage`. - https://github.com/eclipse-syson/syson/issues/1355[#1355] [tests] Add coding rules tests on all modules. +- https://github.com/eclipse-syson/syson/issues/1530[#1530] [details] Move `RequirementUsage`'s _ReqId_ property from the _Advanced_ tab to the _Core_ tab of the _Details View_. === New features diff --git a/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/CoreFeaturesSwitch.java b/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/CoreFeaturesSwitch.java index 9b5ab5216..629dd0cb8 100644 --- a/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/CoreFeaturesSwitch.java +++ b/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/CoreFeaturesSwitch.java @@ -37,6 +37,7 @@ import org.eclipse.syson.sysml.Redefinition; import org.eclipse.syson.sysml.ReferenceSubsetting; import org.eclipse.syson.sysml.RequirementConstraintMembership; +import org.eclipse.syson.sysml.RequirementUsage; import org.eclipse.syson.sysml.Specialization; import org.eclipse.syson.sysml.StateDefinition; import org.eclipse.syson.sysml.StateSubactionMembership; @@ -230,6 +231,14 @@ public List caseRequirementConstraintMembership(RequirementC return features; } + @Override + public List caseRequirementUsage(RequirementUsage object) { + var features = new ArrayList(); + features.addAll(this.caseFeature(object)); + features.add(SysmlPackage.eINSTANCE.getRequirementUsage_ReqId()); + return features; + } + @Override public List caseSpecialization(Specialization object) { var features = new ArrayList(); diff --git a/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java b/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java index 533f3c611..0e9f6d252 100644 --- a/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java +++ b/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java @@ -75,6 +75,16 @@ public void getCoreFeaturesOfMembership() { SysmlPackage.eINSTANCE.getMembership_MemberElement()); } + @Test + public void getCoreFeaturesOfRequirementUsage() { + List coreStructuralFeatures = this.detailsViewService.getCoreFeatures(SysmlFactory.eINSTANCE.createRequirementUsage()); + assertThat(coreStructuralFeatures).containsOnly(SysmlPackage.eINSTANCE.getElement_DeclaredName(), + SysmlPackage.eINSTANCE.getElement_QualifiedName(), + SysmlPackage.eINSTANCE.getElement_DeclaredShortName(), + SysmlPackage.eINSTANCE.getFeature_Direction(), + SysmlPackage.eINSTANCE.getRequirementUsage_ReqId()); + } + @Test public void isReadOnlyElementInImportedLibrary() { Resource resource = new JSONResourceFactory().createResourceFromPath("testResource"); diff --git a/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc b/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc index dd98ecd48..bf1319eef 100644 --- a/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc +++ b/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc @@ -99,7 +99,7 @@ metadata def Function :> SemanticMetadata { #Function action a0; // a0 subset functions #Function action def A0; // A0 subclassify Functions ``` -- Add coding rules tests on all modules. +- Move `RequirementUsage`'s _ReqId_ property from the _Advanced_ tab to the _Core_ tab of the _Details View_. == Dependency update