From 8db51ad38761dadf85944be89d85c770eada502e Mon Sep 17 00:00:00 2001 From: Guillaume Coutable Date: Thu, 28 May 2026 17:23:23 +0200 Subject: [PATCH] [2247] Allow creating timeslices & snapshots from Definition graphical nodes Bug: https://github.com/eclipse-syson/syson/issues/2247 Signed-off-by: Guillaume Coutable --- CHANGELOG.adoc | 2 ++ .../GVTimesliceSnapshotNodeCreationTests.java | 22 +++++++----- ...eneralViewWithTopNodesTestProjectData.java | 4 +++ .../services/aql/ModelMutationAQLService.java | 5 ++- .../MetamodelMutationElementService.java | 13 +++---- .../common/view/services/ViewToolService.java | 36 ++++++++++++------- ...currenceUsageSnapshotNodeToolProvider.java | 3 +- ...urrenceUsageTimesliceNodeToolProvider.java | 3 +- .../services/SDVNodeToolSectionSwitch.java | 6 ++++ .../pages/release-notes/2026.7.0.adoc | 3 ++ 10 files changed, 64 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index b32f5ba80..faaf5c968 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -41,6 +41,8 @@ Disabling the _Hide expression internals_ filter in the _Explorer_ view allows t - https://github.com/eclipse-syson/syson/issues/2231[#2231] [diagrams] Add a new tool to create a _frame_ `ConcernUsage` from `RequirementUsage` and `RequirementDefinition` graphical nodes. - https://github.com/eclipse-syson/syson/issues/2231[#2231] [diagrams] Add the support for the _frames_ compartment graphical node in `RequirementUsage` and `RequirementDefinition` graphical nodes. - https://github.com/eclipse-syson/syson/issues/2235[#2235] [diagrams] Leverage the selection dialog to improve the graphical node tool creating a _frame_ `ConcernUsage` from `RequirementUsage` and `RequirementDefinition` graphical nodes. +- https://github.com/eclipse-syson/syson/issues/2247[#2247] [diagrams] Add the support for creating _timeslices/snapshots_ from the different kind of `OccurrenceDefiniton` graphical nodes. +It leverages the selection dialog to either create an _occurrence timeslice/snapshot_, or the _usage timeslice/snapshot_ matching the `OccurrenceDefinition` on which the tool is applied. == v2026.5.0 diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVTimesliceSnapshotNodeCreationTests.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVTimesliceSnapshotNodeCreationTests.java index b830c95f5..6d3e11266 100644 --- a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVTimesliceSnapshotNodeCreationTests.java +++ b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVTimesliceSnapshotNodeCreationTests.java @@ -152,11 +152,15 @@ private static Stream portionKingNodeParameters() { private static Stream portionKindSelectionDialogTreeParameters() { return Stream.of( - Arguments.of(SysmlPackage.eINSTANCE.getAllocationUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.ALLOCATION_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.ALLOCATION_USAGE_ID), - Arguments.of(SysmlPackage.eINSTANCE.getInterfaceUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.INTERFACE_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.INTERFACE_USAGE_ID), - Arguments.of(SysmlPackage.eINSTANCE.getItemUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.ITEM_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.ITEM_USAGE_ID), - Arguments.of(SysmlPackage.eINSTANCE.getOccurrenceUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.OCCURRENCE_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.OCCURRENCE_USAGE_ID), - Arguments.of(SysmlPackage.eINSTANCE.getPartUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.PART_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.PART_USAGE_ID) + Arguments.of(SysmlPackage.eINSTANCE.getAllocationDefinition(), SysmlPackage.eINSTANCE.getAllocationUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.ALLOCATION_DEFINITION_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.ALLOCATION_DEFINITION_ID), + Arguments.of(SysmlPackage.eINSTANCE.getAllocationUsage(), SysmlPackage.eINSTANCE.getAllocationUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.ALLOCATION_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.ALLOCATION_USAGE_ID), + Arguments.of(SysmlPackage.eINSTANCE.getInterfaceUsage(), SysmlPackage.eINSTANCE.getInterfaceUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.INTERFACE_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.INTERFACE_USAGE_ID), + Arguments.of(SysmlPackage.eINSTANCE.getItemDefinition(), SysmlPackage.eINSTANCE.getItemUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.ITEM_DEFINITION_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.ITEM_DEFINITION_ID), + Arguments.of(SysmlPackage.eINSTANCE.getItemUsage(), SysmlPackage.eINSTANCE.getItemUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.ITEM_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.ITEM_USAGE_ID), + Arguments.of(SysmlPackage.eINSTANCE.getOccurrenceDefinition(), SysmlPackage.eINSTANCE.getOccurrenceUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.OCCURRENCE_DEFINITION_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.OCCURRENCE_DEFINITION_ID), + Arguments.of(SysmlPackage.eINSTANCE.getOccurrenceUsage(), SysmlPackage.eINSTANCE.getOccurrenceUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.OCCURRENCE_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.OCCURRENCE_USAGE_ID), + Arguments.of(SysmlPackage.eINSTANCE.getPartDefinition(), SysmlPackage.eINSTANCE.getPartUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.PART_DEFINITION_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.PART_DEFINITION_ID), + Arguments.of(SysmlPackage.eINSTANCE.getPartUsage(), SysmlPackage.eINSTANCE.getPartUsage(), GeneralViewWithTopNodesTestProjectData.GraphicalIds.PART_USAGE_ID, GeneralViewWithTopNodesTestProjectData.SemanticIds.PART_USAGE_ID) ).map(TestNameGenerator::namedArguments); }; @@ -251,7 +255,7 @@ public void createSnapshotNodeOn(EClass parentEClass, String parentTargetObjectI @ParameterizedTest @MethodSource("portionKindSelectionDialogTreeParameters") - public void testCheckAvailableElementsInTimesliceSelectionDialog(EClass elementClass, String graphicalId, String semanticId) { + public void testCheckAvailableElementsInTimesliceSelectionDialog(EClass elementClass, EClass expectedTimesliceEClass, String graphicalId, String semanticId) { var diagramDescription = this.givenDiagramDescription.getDiagramDescription(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, SysONRepresentationDescriptionIdentifiers.GENERAL_VIEW_DIAGRAM_DESCRIPTION_ID); var diagramDescriptionIdProvider = new DiagramDescriptionIdProvider(diagramDescription, this.diagramIdProvider); @@ -264,7 +268,7 @@ public void testCheckAvailableElementsInTimesliceSelectionDialog(EClass elementC Consumer initialTreeContentConsumer = assertRefreshedTreeThat(tree -> { assertThat(tree).isNotNull(); assertThat(tree.getChildren()).size().isEqualTo(1); - assertThat(tree.getChildren().getFirst().getId()).isEqualTo(identityService.getId(elementClass)); + assertThat(tree.getChildren().getFirst().getId()).isEqualTo(identityService.getId(expectedTimesliceEClass)); }); StepVerifier.create(flux) @@ -275,7 +279,7 @@ public void testCheckAvailableElementsInTimesliceSelectionDialog(EClass elementC @ParameterizedTest @MethodSource("portionKindSelectionDialogTreeParameters") - public void testCheckAvailableElementsInSnapshotSelectionDialog(EClass elementClass, String graphicalId, String semanticId) { + public void testCheckAvailableElementsInSnapshotSelectionDialog(EClass elementClass, EClass expectedSnapshotEClass, String graphicalId, String semanticId) { var diagramDescription = this.givenDiagramDescription.getDiagramDescription(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, SysONRepresentationDescriptionIdentifiers.GENERAL_VIEW_DIAGRAM_DESCRIPTION_ID); var diagramDescriptionIdProvider = new DiagramDescriptionIdProvider(diagramDescription, this.diagramIdProvider); @@ -288,7 +292,7 @@ public void testCheckAvailableElementsInSnapshotSelectionDialog(EClass elementCl Consumer initialTreeContentConsumer = assertRefreshedTreeThat(tree -> { assertThat(tree).isNotNull(); assertThat(tree.getChildren()).size().isEqualTo(1); - assertThat(tree.getChildren().getFirst().getId()).isEqualTo(identityService.getId(elementClass)); + assertThat(tree.getChildren().getFirst().getId()).isEqualTo(identityService.getId(expectedSnapshotEClass)); }); StepVerifier.create(flux) diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/GeneralViewWithTopNodesTestProjectData.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/GeneralViewWithTopNodesTestProjectData.java index 74464c94a..efebbc237 100644 --- a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/GeneralViewWithTopNodesTestProjectData.java +++ b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/GeneralViewWithTopNodesTestProjectData.java @@ -30,6 +30,8 @@ public static class GraphicalIds { public static final String ACTION_USAGE_ID = "61aaf64a-4fbc-356e-ba73-4bd47b386989"; + public static final String ALLOCATION_DEFINITION_ID = "304ed5e0-b3e2-3399-b110-8836d4b27127"; + public static final String ALLOCATION_USAGE_ID = "361506fb-2a1d-3edc-be2d-8cd60a235f53"; public static final String ATTRIBUTE_USAGE_ID = "7b8e6835-c563-35cd-8991-e2f894fc2139"; @@ -50,6 +52,8 @@ public static class GraphicalIds { public static final String PART_USAGE_ID = "4c4fe0d5-4974-377e-9113-9ab022c75f8c"; + public static final String OCCURRENCE_DEFINITION_ID = "af3a9437-85c6-3bce-a62e-20aa80f277f4"; + public static final String OCCURRENCE_USAGE_ID = "47653014-87d1-3dc6-856b-72454aa93154"; public static final String REQUIREMENT_DEFINITION_ID = "b83f2b54-1602-382d-beb1-c500e08a8684"; diff --git a/backend/services/syson-model-services/src/main/java/org/eclipse/syson/model/services/aql/ModelMutationAQLService.java b/backend/services/syson-model-services/src/main/java/org/eclipse/syson/model/services/aql/ModelMutationAQLService.java index c6fc77dfe..44970c6a9 100644 --- a/backend/services/syson-model-services/src/main/java/org/eclipse/syson/model/services/aql/ModelMutationAQLService.java +++ b/backend/services/syson-model-services/src/main/java/org/eclipse/syson/model/services/aql/ModelMutationAQLService.java @@ -21,7 +21,6 @@ import org.eclipse.syson.sysml.Documentation; import org.eclipse.syson.sysml.Element; import org.eclipse.syson.sysml.Membership; -import org.eclipse.syson.sysml.OccurrenceUsage; import org.eclipse.syson.sysml.PartUsage; import org.eclipse.syson.sysml.RequirementUsage; import org.eclipse.syson.sysml.Type; @@ -95,9 +94,9 @@ public Element createSatisfyRequirement(Element self, Element selectedObject) { } /** - * {@link MetamodelMutationElementService#createOccurrenceInOccurrence(OccurrenceUsage, EClass)}. + * {@link MetamodelMutationElementService#createOccurrenceInOccurrence(Type, EClass)}. */ - public EObject createOccurrenceInOccurrence(OccurrenceUsage container, EClass eClass) { + public EObject createOccurrenceInOccurrence(Type container, EClass eClass) { return this.metamodelElementMutationService.createOccurrenceInOccurrence(container, eClass); } diff --git a/backend/services/syson-sysml-metamodel-services/src/main/java/org/eclipse/syson/sysml/metamodel/services/MetamodelMutationElementService.java b/backend/services/syson-sysml-metamodel-services/src/main/java/org/eclipse/syson/sysml/metamodel/services/MetamodelMutationElementService.java index d003f66bb..54521e680 100644 --- a/backend/services/syson-sysml-metamodel-services/src/main/java/org/eclipse/syson/sysml/metamodel/services/MetamodelMutationElementService.java +++ b/backend/services/syson-sysml-metamodel-services/src/main/java/org/eclipse/syson/sysml/metamodel/services/MetamodelMutationElementService.java @@ -32,6 +32,7 @@ import org.eclipse.syson.sysml.InterfaceUsage; import org.eclipse.syson.sysml.Membership; import org.eclipse.syson.sysml.Namespace; +import org.eclipse.syson.sysml.OccurrenceDefinition; import org.eclipse.syson.sysml.OccurrenceUsage; import org.eclipse.syson.sysml.Package; import org.eclipse.syson.sysml.PortUsage; @@ -212,17 +213,17 @@ public InterfaceUsage createInterfaceUsage(PortUsage source, PortUsage target, E } /** - * Creates an instance of {@code eClass} in the given {@link OccurrenceUsage} container. - *

It returns {@code null} if the {@code eClass} is not assignable to {@link OccurrenceUsage}

+ * Creates an instance of {@code eClass} in the given {@link Type} container if it is an {@link OccurrenceUsage} or an {@link OccurrenceDefinition}. + *

It returns {@code null} if the {@code eClass} is not assignable to {@link OccurrenceUsage} or the {@code container} is not assignable to either @link OccurrenceUsage} or {@link OccurrenceDefinition}

* * @param container - * the {@link OccurrenceUsage} container + * the {@link Type} container * @param eClass * the {@link EClass} assignable to {@link OccurrenceUsage} to instantiate - * @return a new {@link EClass} instantiated {@link EObject}, {@code null} if the {@code eClass} is not assignable to {@link OccurrenceUsage} + * @return a new {@link EClass} instantiated {@link EObject}, {@code null} if the {@code eClass} is not assignable to {@link OccurrenceUsage} and the {@code container} is not assignable to either {@link OccurrenceUsage} or {@link OccurrenceDefinition} */ - public EObject createOccurrenceInOccurrence(OccurrenceUsage container, EClass eClass) { - if (SysmlPackage.eINSTANCE.getOccurrenceUsage().isSuperTypeOf(eClass)) { + public EObject createOccurrenceInOccurrence(Type container, EClass eClass) { + if ((container instanceof OccurrenceUsage || container instanceof OccurrenceDefinition) && SysmlPackage.eINSTANCE.getOccurrenceUsage().isSuperTypeOf(eClass)) { var membership = SysmlFactory.eINSTANCE.createFeatureMembership(); var timeSlice = (OccurrenceUsage) SysmlFactory.eINSTANCE.create(eClass); membership.getOwnedRelatedElement().add(timeSlice); diff --git a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewToolService.java b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewToolService.java index 226c5af5c..91d039150 100644 --- a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewToolService.java +++ b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewToolService.java @@ -41,13 +41,17 @@ import org.eclipse.syson.sysml.ActionDefinition; import org.eclipse.syson.sysml.ActionUsage; import org.eclipse.syson.sysml.ActorMembership; +import org.eclipse.syson.sysml.AllocationDefinition; import org.eclipse.syson.sysml.CaseDefinition; import org.eclipse.syson.sysml.CaseUsage; import org.eclipse.syson.sysml.Comment; +import org.eclipse.syson.sysml.ConnectionDefinition; +import org.eclipse.syson.sysml.ConstraintDefinition; import org.eclipse.syson.sysml.Definition; import org.eclipse.syson.sysml.Documentation; import org.eclipse.syson.sysml.Element; import org.eclipse.syson.sysml.FeatureMembership; +import org.eclipse.syson.sysml.ItemDefinition; import org.eclipse.syson.sysml.Membership; import org.eclipse.syson.sysml.ObjectiveMembership; import org.eclipse.syson.sysml.OwningMembership; @@ -425,19 +429,6 @@ public List getNamespaceImportSelectionDialogElements(IEditingContext ed * {@link Package}. */ public List getNamespaceImportSelectionDialogChildren(Object selectionDialogTreeElement, IEditingContext editingContext, List expandedIds) { - // List result = new ArrayList<>(); - // if (self instanceof Resource resource) { - // resource.getContents().stream() - // .filter(Element.class::isInstance) - // .map(Element.class::cast) - // .forEach(element -> result.addAll(this.findClosestPackageInChildren(element))); - // } else if (self instanceof Package packageElement) { - // packageElement.getOwnedRelationship().stream() - // .filter(Membership.class::isInstance) - // .map(Membership.class::cast) - // .forEach(membership -> result.addAll(this.findClosestPackageInChildren(membership))); - // } - // return result; return this.getChildrenWithInstancesOf(selectionDialogTreeElement, editingContext, expandedIds, List.of(SysmlPackage.eINSTANCE.getPackage())); } @@ -667,6 +658,25 @@ public List getSelectionDialogChildren(Object selectionDialogT return this.getChildrenWithInstancesOf(selectionDialogTreeElement, editingContext, expandedIds, candidates); } + /** + * Return the {@code Usage} {@link EClass} corresponding to the given {@link Type}. + * + * @param type + * the type we want the {@code Usage} {@link EClass} + * @return the {@code Usage} {@link EClass} corresponding to the given {@link Type} + */ + public EClass getPortionKindSelectionDialogElement(Type type) { + return switch (type) { + case AllocationDefinition a -> SysmlPackage.eINSTANCE.getAllocationUsage(); + case ConnectionDefinition c -> SysmlPackage.eINSTANCE.getConnectionUsage(); + case PartDefinition p -> SysmlPackage.eINSTANCE.getPartUsage(); + case ConstraintDefinition c -> SysmlPackage.eINSTANCE.getConstraintUsage(); + case ItemDefinition i -> SysmlPackage.eINSTANCE.getItemUsage(); + case Usage u -> u.eClass(); + default -> SysmlPackage.eINSTANCE.getOccurrenceUsage(); + }; + } + protected List getAllResourcesWithInstancesOf(IEditingContext editingContext, List eClassifiers) { var elementsContainingClassifiers = new ArrayList<>(); List elements = this.sysONExplorerService.getElements(editingContext, List.of()); diff --git a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageSnapshotNodeToolProvider.java b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageSnapshotNodeToolProvider.java index ef16851d2..7fd49a41b 100644 --- a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageSnapshotNodeToolProvider.java +++ b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageSnapshotNodeToolProvider.java @@ -24,6 +24,7 @@ import org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription; import org.eclipse.sirius.components.view.emf.diagram.ViewDiagramDescriptionConverter; import org.eclipse.syson.diagram.common.view.services.ViewCreateService; +import org.eclipse.syson.diagram.common.view.services.ViewToolService; import org.eclipse.syson.diagram.services.aql.DiagramMutationAQLService; import org.eclipse.syson.sysml.PortionKind; import org.eclipse.syson.sysml.SysmlPackage; @@ -104,7 +105,7 @@ private DialogDescription getDescriptionDialog() { private SelectionDialogTreeDescription getDialogTreeDescriptionDialog() { return this.diagramBuilderHelper.newSelectionDialogTreeDescription() - .elementsExpression(AQLConstants.AQL_SELF + ".eClass()") + .elementsExpression(ServiceMethod.of0(ViewToolService::getPortionKindSelectionDialogElement).aqlSelf()) .isSelectableExpression(AQLConstants.AQL_TRUE) .build(); } diff --git a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageTimesliceNodeToolProvider.java b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageTimesliceNodeToolProvider.java index 446fdf713..8878ea4bf 100644 --- a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageTimesliceNodeToolProvider.java +++ b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageTimesliceNodeToolProvider.java @@ -24,6 +24,7 @@ import org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription; import org.eclipse.sirius.components.view.emf.diagram.ViewDiagramDescriptionConverter; import org.eclipse.syson.diagram.common.view.services.ViewCreateService; +import org.eclipse.syson.diagram.common.view.services.ViewToolService; import org.eclipse.syson.diagram.services.aql.DiagramMutationAQLService; import org.eclipse.syson.model.services.aql.ModelMutationAQLService; import org.eclipse.syson.sysml.PortionKind; @@ -105,7 +106,7 @@ private DialogDescription getDescriptionDialog() { private SelectionDialogTreeDescription getDialogTreeDescriptionDialog() { return this.diagramBuilderHelper.newSelectionDialogTreeDescription() - .elementsExpression(AQLConstants.AQL_SELF + ".eClass()") + .elementsExpression(ServiceMethod.of0(ViewToolService::getPortionKindSelectionDialogElement).aqlSelf()) .isSelectableExpression(AQLConstants.AQL_TRUE) .build(); } diff --git a/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/services/SDVNodeToolSectionSwitch.java b/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/services/SDVNodeToolSectionSwitch.java index b44f8f24c..7a05bc4b1 100644 --- a/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/services/SDVNodeToolSectionSwitch.java +++ b/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/services/SDVNodeToolSectionSwitch.java @@ -402,6 +402,8 @@ public List caseInterfaceDefinition(InterfaceDefinition object) @Override public List caseItemDefinition(ItemDefinition object) { var sections = this.toolDescriptionService.createDefaultNodeToolSections(); + this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new OccurrenceUsageTimesliceNodeToolProvider().create(cache)); + this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new OccurrenceUsageSnapshotNodeToolProvider().create(cache)); this.toolDescriptionService.addNodeTool(sections, ToolConstants.STRUCTURE, this.toolDescriptionService.createNodeTool(this.getNodeDescription(SysmlPackage.eINSTANCE.getItemUsage()), SysmlPackage.eINSTANCE.getItemUsage())); this.toolDescriptionService.addNodeTool(sections, ToolConstants.STRUCTURE, this.toolDescriptionService @@ -456,6 +458,8 @@ public List caseOccurrenceDefinition(OccurrenceDefinition objec var sections = this.toolDescriptionService.createDefaultNodeToolSections(); this.toolDescriptionService.addNodeTool(sections, ToolConstants.STRUCTURE, this.toolDescriptionService.createNodeTool(this.getNodeDescription(SysmlPackage.eINSTANCE.getPartUsage()), SysmlPackage.eINSTANCE.getPartUsage())); + this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new OccurrenceUsageTimesliceNodeToolProvider().create(cache)); + this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new OccurrenceUsageSnapshotNodeToolProvider().create(cache)); this.toolDescriptionService.addNodeTool(sections, ToolConstants.VIEW_AS, new ViewNodeAsToolProvider(AQLUtils.aqlString(StandardDiagramsConstants.GV_QN), StandardDiagramsConstants.GV).create(this.cache)); @@ -528,6 +532,8 @@ public List casePartDefinition(PartDefinition object) { new ExhibitStateNodeToolProvider(false).create(this.cache)); this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new ExhibitStateNodeToolProvider(true).create(this.cache)); + this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new OccurrenceUsageTimesliceNodeToolProvider().create(cache)); + this.toolDescriptionService.addNodeTool(sections, ToolConstants.BEHAVIOR, new OccurrenceUsageSnapshotNodeToolProvider().create(cache)); this.createToolsForCompartmentItems(object, sections, this.cache); diff --git a/doc/content/modules/user-manual/pages/release-notes/2026.7.0.adoc b/doc/content/modules/user-manual/pages/release-notes/2026.7.0.adoc index 58d14e15c..688510565 100644 --- a/doc/content/modules/user-manual/pages/release-notes/2026.7.0.adoc +++ b/doc/content/modules/user-manual/pages/release-notes/2026.7.0.adoc @@ -29,6 +29,9 @@ image::release-notes-frames-compartment.png[frames compartment displaying concer ** Leverage the selection dialog to improve the graphical node tool creating a _frame_ `ConcernUsage` from `RequirementUsage` and `RequirementDefinition` graphical nodes. +** Add the support for creating _timeslices/snapshots_ from the different kind of `OccurrenceDefiniton` graphical nodes. +It leverages the selection dialog to either create an _occurrence timeslice/snapshot_, or the _usage timeslice/snapshot_ matching the `OccurrenceDefinition` on which the tool is applied. + * In the _Explorer_ view: ** The tree items corresponding to the internals of `Expression` elements (syntax tree) are now hidden by default.