diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index f7f4f7281..491f35a13 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -38,6 +38,7 @@ The property `SysONTestsProperties#ELASTICSEARCH` has been removed, tests that r - https://github.com/eclipse-syson/syson/issues/1860[#1860] [diagrams] Add a precondition for compartment item node descriptions in order to filter out unwanted types. For example `ViewUsage` elements are no longer rendered in _parts_ compartments. - https://github.com/eclipse-syson/syson/issues/1981[#1981] [export] Fix an error during textual export where `Expose` elements with apostrophes in their name were not properly escaped. +- https://github.com/eclipse-syson/syson/issues/1983[#1983] [metamodel] `reqId` and `declaredShortName` properties of `RequirementDefinition` and `RequirementUsage` are now synchronized, as required by the SysMLv2 specification. === Improvements @@ -65,6 +66,7 @@ Also add a _New Satisfy Requirement_ graphical edge tool between `Feature` grap As a result, the application won't start if a service call is constructed with an invalid number of arguments. - https://github.com/eclipse-syson/syson/issues/1988[#1988] [syson] Extract Elasticsearch container initialization in a dedicated abstract test class. Integration tests that require Elasticsearch now need to extend `AbstractIntegrationTestsWithElasticsearch`. +- https://github.com/eclipse-syson/syson/issues/1983[#1983] [details] `reqId` property of `RequirementDefinition` is now visible in 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 629dd0cb8..58b83c21e 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2025 Obeo. + * Copyright (c) 2023, 2026 Obeo. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -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.RequirementDefinition; import org.eclipse.syson.sysml.RequirementUsage; import org.eclipse.syson.sysml.Specialization; import org.eclipse.syson.sysml.StateDefinition; @@ -231,6 +232,14 @@ public List caseRequirementConstraintMembership(RequirementC return features; } + @Override + public List caseRequirementDefinition(RequirementDefinition object) { + var features = new ArrayList(); + features.addAll(this.caseElement(object)); + features.add(SysmlPackage.eINSTANCE.getRequirementDefinition_ReqId()); + return features; + } + @Override public List caseRequirementUsage(RequirementUsage 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 affb81e96..525ec2db1 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024, 2025 Obeo. + * Copyright (c) 2024, 2026 Obeo. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -78,6 +78,15 @@ public void getCoreFeaturesOfMembership() { SysmlPackage.eINSTANCE.getMembership_MemberElement()); } + @Test + public void getCoreFeaturesOfRequirementDefinition() { + List coreStructuralFeatures = this.detailsViewService.getCoreFeatures(SysmlFactory.eINSTANCE.createRequirementDefinition()); + assertThat(coreStructuralFeatures).containsOnly(SysmlPackage.eINSTANCE.getElement_DeclaredName(), + SysmlPackage.eINSTANCE.getElement_QualifiedName(), + SysmlPackage.eINSTANCE.getElement_DeclaredShortName(), + SysmlPackage.eINSTANCE.getRequirementDefinition_ReqId()); + } + @Test public void getCoreFeaturesOfRequirementUsage() { List coreStructuralFeatures = this.detailsViewService.getCoreFeatures(SysmlFactory.eINSTANCE.createRequirementUsage()); diff --git a/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImpl.java b/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImpl.java index f47fa8e7d..1df6fc262 100644 --- a/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImpl.java +++ b/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2023, 2025 Obeo. +* Copyright (c) 2023, 2026 Obeo. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -349,4 +349,23 @@ public String toString() { return result.toString(); } + /** + * Redefines getter + * + * @generated NOT + */ + @Override + public String getDeclaredShortName() { + return this.getReqId(); + } + + /** + * Redefines setter + * + * @generated NOT + */ + @Override + public void setDeclaredShortName(String newDeclaredShortName) { + this.setReqId(newDeclaredShortName); + } } // RequirementDefinitionImpl diff --git a/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementUsageImpl.java b/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementUsageImpl.java index 1f31f0c2b..5352a9967 100644 --- a/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementUsageImpl.java +++ b/backend/metamodel/syson-sysml-metamodel/src/main/java/org/eclipse/syson/sysml/impl/RequirementUsageImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, 2025 Obeo. + * Copyright (c) 2023, 2026 Obeo. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -401,4 +401,23 @@ public Predicate getConstraintDefinition() { return this.getRequirementDefinition(); } + /** + * Redefines getter + * + * @generated NOT + */ + @Override + public String getDeclaredShortName() { + return this.getReqId(); + } + + /** + * Redefines setter + * + * @generated NOT + */ + @Override + public void setDeclaredShortName(String newDeclaredShortName) { + this.setReqId(newDeclaredShortName); + } } // RequirementUsageImpl diff --git a/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImplTest.java b/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImplTest.java index 94aa22245..cac2e010e 100644 --- a/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImplTest.java +++ b/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementDefinitionImplTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2025 Obeo. + * Copyright (c) 2025, 2026 Obeo. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -12,6 +12,8 @@ *******************************************************************************/ package org.eclipse.syson.sysml.impl; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.util.List; import java.util.stream.Stream; @@ -70,4 +72,14 @@ public void testGetStakeholderParameter() { Assertions.assertNotNull(stakeholderParameterValue); Assertions.assertIterableEquals(STAKEHOLDER_PART_USAGES, stakeholderParameterValue); } + + @Test + public void testReqId() { + REQUIREMENT_DEFINITION.setReqId("REQID"); + assertEquals("REQID", REQUIREMENT_DEFINITION.getReqId()); + assertEquals("REQID", REQUIREMENT_DEFINITION.getDeclaredShortName()); + REQUIREMENT_DEFINITION.setDeclaredShortName("DECLARED_SHORT_NAME"); + assertEquals("DECLARED_SHORT_NAME", REQUIREMENT_DEFINITION.getReqId()); + assertEquals("DECLARED_SHORT_NAME", REQUIREMENT_DEFINITION.getDeclaredShortName()); + } } diff --git a/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementUsageImplTest.java b/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementUsageImplTest.java index 5666a75a4..ff3c28efb 100644 --- a/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementUsageImplTest.java +++ b/backend/metamodel/syson-sysml-metamodel/src/test/java/org/eclipse/syson/sysml/impl/RequirementUsageImplTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2025 Obeo. + * Copyright (c) 2025, 2026 Obeo. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -12,6 +12,10 @@ *******************************************************************************/ package org.eclipse.syson.sysml.impl; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertIterableEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.util.List; import java.util.stream.Stream; @@ -21,7 +25,6 @@ import org.eclipse.syson.sysml.StakeholderMembership; import org.eclipse.syson.sysml.SysmlFactory; import org.eclipse.syson.sysml.SysmlPackage; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -60,14 +63,24 @@ public static void setUpRequirementUsage() { @Test public void testGetActorParameter() { final List actorParameterValue = REQUIREMENT_USAGE.getActorParameter(); - Assertions.assertNotNull(actorParameterValue); - Assertions.assertIterableEquals(ACTOR_PART_USAGES, actorParameterValue); + assertNotNull(actorParameterValue); + assertIterableEquals(ACTOR_PART_USAGES, actorParameterValue); } @Test public void testGetStakeholderParameter() { final List stakeholderParameterValue = REQUIREMENT_USAGE.getStakeholderParameter(); - Assertions.assertNotNull(stakeholderParameterValue); - Assertions.assertIterableEquals(STAKEHOLDER_PART_USAGES, stakeholderParameterValue); + assertNotNull(stakeholderParameterValue); + assertIterableEquals(STAKEHOLDER_PART_USAGES, stakeholderParameterValue); + } + + @Test + public void testReqId() { + REQUIREMENT_USAGE.setReqId("REQID"); + assertEquals("REQID", REQUIREMENT_USAGE.getReqId()); + assertEquals("REQID", REQUIREMENT_USAGE.getDeclaredShortName()); + REQUIREMENT_USAGE.setDeclaredShortName("DECLARED_SHORT_NAME"); + assertEquals("DECLARED_SHORT_NAME", REQUIREMENT_USAGE.getReqId()); + assertEquals("DECLARED_SHORT_NAME", REQUIREMENT_USAGE.getDeclaredShortName()); } } diff --git a/doc/content/modules/user-manual/pages/release-notes/2026.3.0.adoc b/doc/content/modules/user-manual/pages/release-notes/2026.3.0.adoc index 14671821f..38d1eb17f 100644 --- a/doc/content/modules/user-manual/pages/release-notes/2026.3.0.adoc +++ b/doc/content/modules/user-manual/pages/release-notes/2026.3.0.adoc @@ -61,6 +61,10 @@ part system { } ``` +* In _Details_ view: + +** `Req Id` and `Declared Short Name` properties of `RequirementDefinition` and `RequirementUsage` are now synchronized, as required by the SysMLv2 specification. + == Improvements * In diagrams: @@ -100,7 +104,13 @@ package root { ``` ** Implement the textual export for `AllocationUsage` and `AllocationDefinition`. -* Add support for publishing representations with libraries. +* In _Details_ view: + +** `Req Id` property of `RequirementDefinition` is now visible in the _Core_ tab of the _Details_ view. + +* Miscellaneous: + +** Add support for publishing representations with libraries. Publishing a project that contains representations now produces libraries that also contain the representations. Users can navigate to `/libraries/` to open a library and see its representations.