Skip to content

Commit c6f4a4d

Browse files
pcdavidAxelRICHARD
authored andcommitted
[1869] Fix actions compartment visibility and label on State nodes
Bug: #1869 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
1 parent df3f923 commit c6f4a4d

5 files changed

Lines changed: 16 additions & 4 deletions

File tree

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ This fix ensure that imported models containing, for example, a top-level `Libra
5757
- https://github.com/eclipse-syson/syson/issues/1876[#1876] [explorer] Fix potential NPE when trying to delete elements with associated `EAnnotations` from the _Explorer_.
5858
- https://github.com/eclipse-syson/syson/issues/1858[#1858] [diagrams] Fix an issue where a new graphical node could be located inside the wrong graphical container.
5959
- https://github.com/eclipse-syson/syson/issues/1859[#1859] [diagrams] Fix an issue where the creation of an `ItemUsage` from an `ActionUsage` or an `ActionDefinition` graphical node was not revealing it.
60+
- https://github.com/eclipse-syson/syson/issues/1869[#1869] [diagrams] When creating a _Do action with referenced action_ on a `StateUsage`, ensure the corresponding compartements are revealed.
6061

6162
=== Improvements
6263

backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVSubNodeActionFlowCreationTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,11 @@ public void createReferencingPerformActionUsageInActionUsage() {
562562

563563
IDiagramChecker diagramChecker = (initialDiagram, newDiagram) -> {
564564
new CheckDiagramElementCount(this.diagramComparator)
565-
.hasNewNodeCount(1) // 1 visible new PerformActionUsage node
566-
.hasNewEdgeCount(2) // 1 visible composition edge and 1 visible ReferenceSubsetting edge
565+
.hasNewNodeCount(4) // 1 visible new PerformActionUsage node + 2 list items (in 'actions' and
566+
// 'perform actions' compartments, now visible) + 1 node in 'action flow'
567+
// compartment
568+
.hasNewEdgeCount(3) // 1 visible composition edge and 2 visible ReferenceSubsetting edge (one for
569+
// the top-level node, one for the node in "action flow" compartment
567570
.check(initialDiagram, newDiagram, true);
568571
String listNodeDescription = this.descriptionNameGenerator.getCompartmentItemName(parentEClass, containmentReference);
569572
new CheckNodeInCompartment(this.diagramDescriptionIdProvider, this.diagramComparator)

backend/services/syson-diagram-services/src/main/java/org/eclipse/syson/diagram/services/DiagramQueryLabelService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class DiagramQueryLabelService implements IDiagramLabelService {
8989
public String getIdentificationLabel(Element element) {
9090
StringBuilder label = new StringBuilder();
9191
if (element instanceof ActionUsage && element.eContainer() instanceof StateSubactionMembership ssm) {
92-
label.append(ssm.getKind());
92+
label.append(ssm.getKind()).append(LabelConstants.SPACE);
9393
}
9494
label.append(this.getShortNameLabel(element));
9595
String declaredName = element.getDeclaredName();
@@ -483,6 +483,7 @@ private String getCompartmentItemStringRepresentation(Usage usage, boolean direc
483483
label.append(this.getTypingLabel(usage));
484484
label.append(this.getRedefinitionLabel(usage));
485485
label.append(this.getSubsettingLabel(usage));
486+
label.append(this.getReferenceSubsettingLabel(usage));
486487
label.append(this.getValueStringRepresentation(usage, directEditInput));
487488
}
488489
return label.toString();

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/RevealCompartmentSwitch.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2025 Obeo.
2+
* Copyright (c) 2025, 2026 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
2121
import org.eclipse.syson.sysml.MergeNode;
2222
import org.eclipse.syson.sysml.OccurrenceDefinition;
2323
import org.eclipse.syson.sysml.OccurrenceUsage;
24+
import org.eclipse.syson.sysml.PerformActionUsage;
2425
import org.eclipse.syson.sysml.PortUsage;
2526
import org.eclipse.syson.sysml.StateUsage;
2627
import org.eclipse.syson.sysml.util.SysmlSwitch;
@@ -48,6 +49,11 @@ public Boolean defaultCase(EObject object) {
4849
return Boolean.TRUE;
4950
}
5051

52+
@Override
53+
public Boolean casePerformActionUsage(PerformActionUsage object) {
54+
return Boolean.TRUE;
55+
}
56+
5157
@Override
5258
public Boolean caseActionUsage(ActionUsage object) {
5359
return !this.isGeneralView;

doc/content/modules/user-manual/pages/release-notes/2026.1.0.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The following structure is not yet handled `connection bus : C connect (d1, d2,
5353
** Fix an issue where the creation of an `Element` inside a `sub-Package` could hide unrelated graphical nodes.
5454
** Fix an issue where a new graphical node could be located inside the wrong graphical container.
5555
** Fix an issue where the creation of an `ItemUsage` from an `ActionUsage` or an `ActionDefinition` graphical node was not revealing it.
56+
** Fix an issue where the creation of a `PerformAction` inside a `StateUsage` did not reveal the corresponding compartments in the `StateUsage` graphical node.
5657

5758
* In _Explorer_ view:
5859

0 commit comments

Comments
 (0)