Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import org.eclipse.syson.sysml.helper.LabelConstants;
import org.eclipse.syson.util.AQLConstants;
import org.eclipse.syson.util.AQLUtils;
import org.eclipse.syson.util.ServiceMethod;
import org.eclipse.syson.util.SysMLMetamodelHelper;
import org.springframework.context.annotation.Configuration;

Expand Down Expand Up @@ -516,7 +517,7 @@ private FormElementFor createCoreWidgets() {
FormElementFor forElt = FormFactory.eINSTANCE.createFormElementFor();
forElt.setName("Widgets for Core Group");
forElt.setIterator(E_STRUCTURAL_FEATURE);
forElt.setIterableExpression(AQLUtils.getSelfServiceCallExpression("getCoreFeatures"));
forElt.setIterableExpression(ServiceMethod.of0(DetailsViewService::getCoreFeatures).aqlSelf());
forElt.getChildren().addAll(this.createWidgets());
return forElt;
}
Expand All @@ -525,7 +526,7 @@ private FormElementFor createAdvancedWidgets() {
FormElementFor forElt = FormFactory.eINSTANCE.createFormElementFor();
forElt.setName("Widgets for Advanced Group");
forElt.setIterator(E_STRUCTURAL_FEATURE);
forElt.setIterableExpression(AQLUtils.getSelfServiceCallExpression("getAdvancedFeatures"));
forElt.setIterableExpression(ServiceMethod.of0(DetailsViewService::getAdvancedFeatures).aqlSelf());
forElt.getChildren().addAll(this.createWidgets());
return forElt;
}
Expand Down Expand Up @@ -659,7 +660,7 @@ private FormElementDescription createDocumentationWidget() {
TextAreaDescription textarea = FormFactory.eINSTANCE.createTextAreaDescription();
textarea.setName("DocumentationWidget");
textarea.setLabelExpression("Documentation");
textarea.setValueExpression(AQLUtils.getSelfServiceCallExpression("getDocumentation"));
textarea.setValueExpression(ServiceMethod.of0(DetailsViewService::getDocumentation).aqlSelf());
textarea.setHelpExpression("Use 'shift + enter' to add new lines");
textarea.setIsEnabledExpression("aql:not(self.isReadOnly())");
ChangeContext setNewValueOperation = ViewFactory.eINSTANCE.createChangeContext();
Expand All @@ -676,7 +677,7 @@ private FormElementDescription createCommentWidget() {
TextAreaDescription textarea = FormFactory.eINSTANCE.createTextAreaDescription();
textarea.setName("CommentWidget");
textarea.setLabelExpression("Comment");
textarea.setValueExpression(AQLUtils.getSelfServiceCallExpression("getCommentBody"));
textarea.setValueExpression(ServiceMethod.of0(DetailsViewService::getCommentBody).aqlSelf());
textarea.setHelpExpression("Use 'shift + enter' to add new lines");
textarea.setIsEnabledExpression("aql:not(self.isReadOnly())");
ChangeContext setNewValueOperation = ViewFactory.eINSTANCE.createChangeContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ logging.level.org.eclipse.sirius.web.diagrams.layout.LayoutService=OFF
# Prevent Elasticsearch from scanning SysON repositories
spring.data.elasticsearch.repositories.enabled=false

# Prevent liquibase to collect analytics
# see https://docs.liquibase.com/reference-guide/parameters/analytics-enabled
liquibase.analytics.enabled=false

##################################################
#
# SYSON CUSTOM IMAGES FOR IMAGES NODES
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,9 +25,12 @@
import org.eclipse.sirius.components.view.diagram.LineStyle;
import org.eclipse.sirius.components.view.diagram.NodeDescription;
import org.eclipse.sirius.components.view.diagram.SynchronizationPolicy;
import org.eclipse.syson.diagram.common.view.services.ViewEdgeService;
import org.eclipse.syson.sysml.BindingConnectorAsUsage;
import org.eclipse.syson.sysml.SysmlPackage;
import org.eclipse.syson.util.AQLConstants;
import org.eclipse.syson.util.AQLUtils;
import org.eclipse.syson.util.ServiceMethod;
import org.eclipse.syson.util.SysMLMetamodelHelper;
import org.eclipse.syson.util.ViewConstants;

Expand Down Expand Up @@ -78,10 +81,10 @@ public EdgeDescription create() {
.centerLabelExpression("=")
.name(this.getName())
.semanticCandidatesExpression(AQLUtils.getSelfServiceCallExpression("getAllReachable", domainType))
.sourceExpression("aql:self.featureWithValue")
.sourceExpression(AQLConstants.AQL_SELF + "." + SysmlPackage.eINSTANCE.getFeatureValue_FeatureWithValue().getName())
.style(this.createEdgeStyle())
.synchronizationPolicy(SynchronizationPolicy.SYNCHRONIZED)
.targetExpression(AQLUtils.getSelfServiceCallExpression("getFeatureValueTarget"))
.targetExpression(ServiceMethod.of0(ViewEdgeService::getFeatureValueTarget).aqlSelf())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -34,11 +34,14 @@
import org.eclipse.sirius.components.view.diagram.SynchronizationPolicy;
import org.eclipse.syson.diagram.common.view.nodes.DoneActionNodeDescriptionProvider;
import org.eclipse.syson.diagram.common.view.nodes.StartActionNodeDescriptionProvider;
import org.eclipse.syson.diagram.common.view.services.ViewEdgeService;
import org.eclipse.syson.diagram.services.aql.DiagramQueryAQLService;
import org.eclipse.syson.sysml.SysmlPackage;
import org.eclipse.syson.sysml.TransitionUsage;
import org.eclipse.syson.util.AQLConstants;
import org.eclipse.syson.util.AQLUtils;
import org.eclipse.syson.util.IDescriptionNameGenerator;
import org.eclipse.syson.util.ServiceMethod;
import org.eclipse.syson.util.SysMLMetamodelHelper;
import org.eclipse.syson.util.ViewConstants;

Expand Down Expand Up @@ -66,15 +69,16 @@ public EdgeDescription create() {
return this.getDiagramBuilderHelper().newEdgeDescription()
.domainType(domainType)
.isDomainBasedEdge(true)
.centerLabelExpression(AQLUtils.getSelfServiceCallExpression("getTransitionLabel"))
.centerLabelExpression(ServiceMethod.of0(DiagramQueryAQLService::getTransitionLabel).aqlSelf())
.name(this.getEdgeDescriptionName())
.preconditionExpression("aql:graphicalEdgeSource.isInSameGraphicalContainer(graphicalEdgeTarget,cache)")
.preconditionExpression(ServiceMethod.of2(ViewEdgeService::isInSameGraphicalContainer).aql(org.eclipse.sirius.components.diagrams.description.EdgeDescription.GRAPHICAL_EDGE_SOURCE,
org.eclipse.sirius.components.diagrams.description.EdgeDescription.GRAPHICAL_EDGE_TARGET, org.eclipse.sirius.components.diagrams.description.DiagramDescription.CACHE))
.semanticCandidatesExpression(AQLUtils.getSelfServiceCallExpression("getAllReachable", domainType))
.sourceExpression(AQLConstants.AQL_SELF + ".source")
.sourceExpression(AQLConstants.AQL_SELF + "." + SysmlPackage.eINSTANCE.getTransitionUsage_Source().getName())
.style(this.createDefaultEdgeStyle())
.conditionalStyles(this.createStateConditionalStyle())
.synchronizationPolicy(SynchronizationPolicy.SYNCHRONIZED)
.targetExpression(AQLConstants.AQL_SELF + ".target")
.targetExpression(AQLConstants.AQL_SELF + "." + SysmlPackage.eINSTANCE.getTransitionUsage_Target().getName())
.build();
}

Expand All @@ -91,18 +95,18 @@ public void link(DiagramDescription diagramDescription, IViewDiagramElementFinde
@Override
protected ChangeContextBuilder getSourceReconnectToolBody() {
return this.getViewBuilderHelper().newChangeContext()
.expression(AQLUtils.getServiceCallExpression(AQLConstants.EDGE_SEMANTIC_ELEMENT, "reconnectSourceTransitionEdge", AQLConstants.SEMANTIC_RECONNECTION_TARGET));
.expression(ServiceMethod.of1(ViewEdgeService::reconnectSourceTransitionEdge).aql(AQLConstants.EDGE_SEMANTIC_ELEMENT, AQLConstants.SEMANTIC_RECONNECTION_TARGET));
}

@Override
protected ChangeContextBuilder getTargetReconnectToolBody() {
return this.getViewBuilderHelper().newChangeContext()
.expression(AQLUtils.getServiceCallExpression(AQLConstants.EDGE_SEMANTIC_ELEMENT, "reconnectTargetTransitionEdge", AQLConstants.SEMANTIC_RECONNECTION_TARGET));
.expression(ServiceMethod.of1(ViewEdgeService::reconnectTargetTransitionEdge).aql(AQLConstants.EDGE_SEMANTIC_ELEMENT, AQLConstants.SEMANTIC_RECONNECTION_TARGET));
}

@Override
protected String getSourceReconnectToolPreconditionExpression() {
return AQLUtils.getServiceCallExpression(AQLConstants.SEMANTIC_OTHER_END, "checkTransitionEdgeTarget", AQLConstants.SEMANTIC_RECONNECTION_TARGET);
return ServiceMethod.of1(ViewEdgeService::checkTransitionEdgeTarget).aql(AQLConstants.SEMANTIC_OTHER_END, AQLConstants.SEMANTIC_RECONNECTION_TARGET);
}

@Override
Expand Down Expand Up @@ -165,7 +169,7 @@ protected ConditionalEdgeStyle createStateConditionalStyle() {
.lineStyle(LineStyle.SOLID)
.sourceArrowStyle(ArrowStyle.NONE)
.targetArrowStyle(ArrowStyle.INPUT_ARROW)
.condition(AQLUtils.getSelfServiceCallExpression("isTransitionUsageForState"))
.condition(ServiceMethod.of0(ViewEdgeService::isTransitionUsageForState).aqlSelf())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,9 +21,10 @@
import org.eclipse.sirius.components.view.diagram.NodePalette;
import org.eclipse.sirius.components.view.diagram.SynchronizationPolicy;
import org.eclipse.sirius.components.view.diagram.UserResizableDirection;
import org.eclipse.syson.services.UtilService;
import org.eclipse.syson.sysml.SysmlPackage;
import org.eclipse.syson.util.AQLUtils;
import org.eclipse.syson.util.IDescriptionNameGenerator;
import org.eclipse.syson.util.ServiceMethod;
import org.eclipse.syson.util.SysMLMetamodelHelper;

/**
Expand Down Expand Up @@ -51,7 +52,7 @@ public NodeDescription create() {
.defaultWidthExpression("36")
.defaultHeightExpression("36")
.name(this.descriptionNameGenerator.getNodeName(DONE_ACTION_NAME))
.semanticCandidatesExpression(AQLUtils.getSelfServiceCallExpression("retrieveStandardDoneAction"))
.semanticCandidatesExpression(ServiceMethod.of0(UtilService::retrieveStandardDoneAction).aqlSelf())
.style(this.createImageNodeStyleDescription("images/done_action.svg"))
.userResizable(UserResizableDirection.NONE)
.synchronizationPolicy(SynchronizationPolicy.UNSYNCHRONIZED)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -27,9 +27,11 @@
import org.eclipse.sirius.components.view.diagram.NodePalette;
import org.eclipse.sirius.components.view.diagram.SynchronizationPolicy;
import org.eclipse.sirius.components.view.diagram.UserResizableDirection;
import org.eclipse.syson.diagram.common.view.services.ViewCreateService;
import org.eclipse.syson.services.UtilService;
import org.eclipse.syson.sysml.SysmlPackage;
import org.eclipse.syson.util.AQLUtils;
import org.eclipse.syson.util.IDescriptionNameGenerator;
import org.eclipse.syson.util.ServiceMethod;
import org.eclipse.syson.util.SysMLMetamodelHelper;

/**
Expand Down Expand Up @@ -57,7 +59,7 @@ public NodeDescription create() {
.defaultWidthExpression("28")
.defaultHeightExpression("28")
.name(this.descriptionNameGenerator.getNodeName(START_ACTION_NAME))
.semanticCandidatesExpression(AQLUtils.getSelfServiceCallExpression("retrieveStandardStartAction"))
.semanticCandidatesExpression(ServiceMethod.of0(UtilService::retrieveStandardStartAction).aqlSelf())
.style(this.createImageNodeStyleDescription("images/start_action.svg"))
.userResizable(UserResizableDirection.NONE)
.synchronizationPolicy(SynchronizationPolicy.UNSYNCHRONIZED)
Expand Down Expand Up @@ -87,14 +89,13 @@ private NodePalette createNodePalette(IViewDiagramElementFinder cache) {
private List<EdgeTool> getEdgeTools(IViewDiagramElementFinder cache) {
var targetElementDescriptions = this.getStartTargetDescriptions(cache);

var builder = this.diagramBuilderHelper.newEdgeTool();
var params = List.of(EdgeDescription.SEMANTIC_EDGE_TARGET, EdgeDescription.EDGE_SOURCE, EdgeDescription.EDGE_TARGET, IEditingContext.EDITING_CONTEXT, IDiagramService.DIAGRAM_SERVICES);
var body = this.viewBuilderHelper.newChangeContext()
.expression(AQLUtils.getServiceCallExpression(EdgeDescription.SEMANTIC_EDGE_SOURCE, "createSuccessionEdge", params));

var createStartEdgeTool = builder.name(this.descriptionNameGenerator.getCreationToolName(SysmlPackage.eINSTANCE.getSuccession()))
var createStartEdgeTool = this.diagramBuilderHelper.newEdgeTool().name(this.descriptionNameGenerator.getCreationToolName(SysmlPackage.eINSTANCE.getSuccession()))
.iconURLsExpression("/icons/full/obj16/Succession.svg")
.body(body.build())
.body(this.viewBuilderHelper.newChangeContext()
.expression(
ServiceMethod.of5(ViewCreateService::createSuccessionEdge).aql(EdgeDescription.SEMANTIC_EDGE_SOURCE, EdgeDescription.SEMANTIC_EDGE_TARGET, EdgeDescription.EDGE_SOURCE,
EdgeDescription.EDGE_TARGET, IEditingContext.EDITING_CONTEXT, IDiagramService.DIAGRAM_SERVICES))
.build())
.targetElementDescriptions(targetElementDescriptions.toArray(NodeDescription[]::new))
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public TransitionUsage reconnectTargetTransitionEdge(TransitionUsage transition,
* The target of the transition
* @return
*/
private boolean checkTransitionEdgeTarget(Element source, Element target) {
public boolean checkTransitionEdgeTarget(Element source, Element target) {
boolean sameParent = false;
if (source instanceof ActionUsage sourceAction && target instanceof ActionUsage targetAction) {
Element sourceParentElement = sourceAction.getOwner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public List<EdgeTool> caseAcceptActionUsage(AcceptActionUsage object) {
var edgeTools = new ArrayList<EdgeTool>();
edgeTools.add(this.edgeToolService.createSuccessionEdgeTool(this.getSuccessionEdgeTargets()));
edgeTools.addAll(this.caseUsage(object));
// since AcceptActionDefintion does not exist, this.caseUsage did not manage the FeatureTyping edge, we need to add it manually.
// since AcceptActionDefinition does not exist, this.caseUsage did not manage the FeatureTyping edge, we need to add it manually.
this.addFeatureTypingEdgeToolForActionUsageSubType(edgeTools);
return edgeTools;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -34,6 +34,7 @@
import org.eclipse.sirius.components.view.emf.diagram.ViewDiagramDescriptionConverter;
import org.eclipse.syson.diagram.services.aql.DiagramMutationAQLService;
import org.eclipse.syson.model.services.aql.ModelMutationAQLService;
import org.eclipse.syson.services.UtilService;
import org.eclipse.syson.sysml.Feature;
import org.eclipse.syson.sysml.FeatureDirectionKind;
import org.eclipse.syson.sysml.FeatureMembership;
Expand Down Expand Up @@ -191,7 +192,7 @@ public NodeTool addExistingElementsTool(boolean recursive, boolean nested) {
ViewDiagramDescriptionConverter.CONVERTED_NODES_VARIABLE));

var changeContextViewUsageOwner = this.viewBuilderHelper.newChangeContext()
.expression(AQLUtils.getSelfServiceCallExpression("getViewUsageOwner"))
.expression(ServiceMethod.of0(UtilService::getViewUsageOwner).aqlSelf())
.children(addToExposedElements.build());

String title = "Add existing elements";
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,10 +17,11 @@
import org.eclipse.sirius.components.view.builder.generated.view.ViewBuilders;
import org.eclipse.sirius.components.view.builder.providers.INodeToolProvider;
import org.eclipse.sirius.components.view.diagram.NodeTool;
import org.eclipse.syson.diagram.common.view.services.ViewCreateService;
import org.eclipse.syson.sysml.PortUsage;
import org.eclipse.syson.sysml.SysmlPackage;
import org.eclipse.syson.util.AQLConstants;
import org.eclipse.syson.util.AQLUtils;
import org.eclipse.syson.util.ServiceMethod;

/**
* Used to create a {@link PortUsage} as the receiver of an accept action usage.
Expand All @@ -38,7 +39,7 @@ public NodeTool create(IViewDiagramElementFinder cache) {
var builder = this.diagramBuilderHelper.newNodeTool();

var creationPayloadServiceCall = this.viewBuilderHelper.newChangeContext()
.expression(AQLUtils.getSelfServiceCallExpression("createAcceptActionReceiver"))
.expression(ServiceMethod.of0(ViewCreateService::createAcceptActionReceiver).aqlSelf())
.build();

var rootChangContext = this.viewBuilderHelper.newChangeContext()
Expand All @@ -49,7 +50,7 @@ public NodeTool create(IViewDiagramElementFinder cache) {
return builder.name("New Port as Receiver")
.iconURLsExpression("/icons/full/obj16/" + SysmlPackage.eINSTANCE.getPortUsage().getName() + ".svg")
.body(rootChangContext)
.preconditionExpression(AQLUtils.getSelfServiceCallExpression("isEmptyAcceptActionUsageReceiver"))
.preconditionExpression(ServiceMethod.of0(ViewCreateService::isEmptyAcceptActionUsageReceiver).aqlSelf())
.build();
}
}
Loading
Loading