From 30954c90b47fe5a87ebf0b5ec7fb5e444bf7295f Mon Sep 17 00:00:00 2001
From: Axel RICHARD
Date: Mon, 29 Sep 2025 10:06:55 +0200
Subject: [PATCH] [1545] Add interconnection compartment on PartDefintion
Bug: https://github.com/eclipse-syson/syson/issues/1545
Signed-off-by: Axel RICHARD
---
CHANGELOG.adoc | 1 +
.../InterconnectionCompartmentNodeDescriptionProvider.java | 6 +++---
.../diagram/common/view/services/ViewFilterSwitch.java | 4 ----
.../diagrams/view/SDVDiagramDescriptionProvider.java | 6 +++++-
.../modules/user-manual/pages/release-notes/2025.10.0.adoc | 1 +
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 095482637..40acbdbff 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -78,6 +78,7 @@ This issue was not visible in SysON but could appear in downstream applications
`SysONUpdateLibraryExecutor` was introduced to fix this issue.
Now it has been fixed in Sirius Web 2025.8.4, `SysONUpdateLibraryExecutor` has been deleted and `UpdateLibraryExecutor` is used again.
- https://github.com/eclipse-syson/syson/issues/1522[#1522] [diagrams] To avoid edge blinking when refreshing the diagram, we need to set the properties `measured.height` and `measured.width` with the value of the node layout data when converting a custom node accordingly to the xyflow https://reactflow.dev/learn/advanced-use/ssr-ssg-configuration#node-dimensions[documentation].
+- https://github.com/eclipse-syson/syson/issues/1545[#1545] [diagrams] Add _interconnection_ compartment to `PartDefinition` nodes in the standard diagrams.
=== Improvements
diff --git a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/InterconnectionCompartmentNodeDescriptionProvider.java b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/InterconnectionCompartmentNodeDescriptionProvider.java
index 775a79256..20484c92c 100644
--- a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/InterconnectionCompartmentNodeDescriptionProvider.java
+++ b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/InterconnectionCompartmentNodeDescriptionProvider.java
@@ -16,7 +16,7 @@
import java.util.List;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramContext;
+import org.eclipse.sirius.components.collaborative.diagrams.DiagramContext;
import org.eclipse.sirius.components.core.api.IEditingContext;
import org.eclipse.sirius.components.view.builder.IViewDiagramElementFinder;
import org.eclipse.sirius.components.view.builder.providers.IColorProvider;
@@ -68,7 +68,7 @@ public NodeDescription create() {
.preconditionExpression(
AQLUtils.getSelfServiceCallExpression("isView",
List.of("'StandardViewDefinitions::InterconnectionView'", org.eclipse.sirius.components.diagrams.description.NodeDescription.ANCESTORS, IEditingContext.EDITING_CONTEXT,
- IDiagramContext.DIAGRAM_CONTEXT)))
+ DiagramContext.DIAGRAM_CONTEXT)))
.semanticCandidatesExpression(AQLConstants.AQL_SELF)
.style(this.createCompartmentNodeStyle())
.userResizable(UserResizableDirection.NONE)
@@ -126,7 +126,7 @@ protected InsideLabelStyle createInsideLabelStyle() {
.fontSize(12)
.italic(true)
.labelColor(this.colorProvider.getColor(ViewConstants.DEFAULT_LABEL_COLOR))
- .showIconExpression("aql:false")
+ .showIconExpression(AQLConstants.AQL_FALSE)
.withHeader(true)
.build();
}
diff --git a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewFilterSwitch.java b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewFilterSwitch.java
index 67ffe0b45..ad281bed8 100644
--- a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewFilterSwitch.java
+++ b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewFilterSwitch.java
@@ -42,10 +42,6 @@
* compartments.
*
*
- * In Interconnection View, the nested Nodes should not be displayed. They are handled by other NodeDescriptions, inside
- * compartments.
- *
- *
* Root elements return true for this switch because the NodeDescriptions calling ViewNodeService#getExposedElements are
* the same for root and nested Nodes.
*
diff --git a/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/SDVDiagramDescriptionProvider.java b/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/SDVDiagramDescriptionProvider.java
index 1878c57cc..b28684db5 100644
--- a/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/SDVDiagramDescriptionProvider.java
+++ b/backend/views/syson-standard-diagrams-view/src/main/java/org/eclipse/syson/standard/diagrams/view/SDVDiagramDescriptionProvider.java
@@ -413,7 +413,7 @@ private List> createAllCompartmentNodeDesc
compartmentNodeDescriptionProviders.addAll(this.createCompartmentsForNestedAction(colorProvider));
// Compartment "interconnection" (many usages and defintions) is defined for:
- // PartUsage
+ // PartUsage, PartDefinition
compartmentNodeDescriptionProviders.addAll(this.createInterconnectionCompartment(colorProvider));
// Compartment "state transition" (OwnedState) is defined for:
@@ -514,6 +514,7 @@ private List> createInterconnectionCompart
final List> compartmentNodeDescriptionProviders = new ArrayList<>();
compartmentNodeDescriptionProviders.add(new InterconnectionCompartmentNodeDescriptionProvider(SysmlPackage.eINSTANCE.getPartUsage(), colorProvider, this.getDescriptionNameGenerator()));
+ compartmentNodeDescriptionProviders.add(new InterconnectionCompartmentNodeDescriptionProvider(SysmlPackage.eINSTANCE.getPartDefinition(), colorProvider, this.getDescriptionNameGenerator()));
return compartmentNodeDescriptionProviders;
}
@@ -1058,6 +1059,9 @@ private void linkInterconnectionCompartment(IViewDiagramElementFinder cache) {
cache.getNodeDescription(this.getDescriptionNameGenerator().getNodeName(SysmlPackage.eINSTANCE.getPartUsage()))
.ifPresent(nd -> cache.getNodeDescription(this.descriptionNameGenerator.getFreeFormCompartmentName(InterconnectionCompartmentNodeDescriptionProvider.COMPARTMENT_NAME))
.ifPresent(nd.getReusedChildNodeDescriptions()::add));
+ cache.getNodeDescription(this.getDescriptionNameGenerator().getNodeName(SysmlPackage.eINSTANCE.getPartDefinition()))
+ .ifPresent(nd -> cache.getNodeDescription(this.descriptionNameGenerator.getFreeFormCompartmentName(InterconnectionCompartmentNodeDescriptionProvider.COMPARTMENT_NAME))
+ .ifPresent(nd.getReusedChildNodeDescriptions()::add));
}
private void addCompartmentNodeDescriptionInNodeDescription(IViewDiagramElementFinder cache, NodeDescription compartmentNodeDescription, EClass eClass) {
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 4c9022968..e17379895 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
@@ -73,6 +73,7 @@ This issue was not visible in SysON but could appear in downstream applications
Now it is only available on SysML model elements.
- Fix library update performance and ensure it does not impact standard libraries.
- Fix an issue where diagrams' edges were blinking when refreshing a diagram.
+- Add _interconnection_ compartment to `PartDefinition` nodes in the standard diagrams.
== Improvements