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
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ All validation rules have been updated to comply with the SysMLv2 2025-04 specif
- https://github.com/eclipse-syson/syson/issues/1411[#1411] [syson] Fix an issue where model and diagrams referencing standard libraries elements might not correctly loaded.
- https://github.com/eclipse-syson/syson/issues/1411[#1411] [syson] Fix an issue where model and diagrams referencing standard libraries elements might not correctly saved.
- https://github.com/eclipse-syson/syson/issues/1407[#1407] [metamodel] Fix an issue where a `Feature` containing a `ChainingFeature` was not typed with the type of the last `ChainingFeature`.
- https://github.com/eclipse-syson/syson/issues/1409[#1409] [import] Fix unresolved elements while importing element with `FeatureChain`.

=== Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.eclipse.syson.sysml.Feature;
import org.eclipse.syson.sysml.FeatureChainExpression;
import org.eclipse.syson.sysml.FeatureReferenceExpression;
import org.eclipse.syson.sysml.FlowUsage;
import org.eclipse.syson.sysml.LiteralInteger;
import org.eclipse.syson.sysml.LiteralString;
import org.eclipse.syson.sysml.Membership;
Expand Down Expand Up @@ -138,6 +139,39 @@ public void tearDown() {
TestTransaction.start();
}

@Test
@DisplayName("GIVEN a model with a FlowUsage using a FeatureChain, WHEN importing the model, THEN the source and the target of the FlowUsage should be properly resolved")
public void checkFlowUsageWithFeatureChain() throws IOException {
var input = """
part def P1Def {
port po1 : PortDef1;
}
port def PortDef1 {
out item item1: P2Def;
}
part def P2Def;
part def P3Def {
in item item2 : P3Def;
}
part p1 {
part p2 : P1Def
part p3 : P3Def;
flow from p2.po1.item1 to p3.item2;
}
""";

this.checker.checkImportedModel(resource -> {
List<FlowUsage> flows = EMFUtils.allContainedObjectOfType(resource, FlowUsage.class)
.toList();
assertThat(flows).hasSize(1);

FlowUsage flow = flows.get(0);
assertThat(flow.getSourceOutputFeature().getFeatureTarget().getName()).isEqualTo("item1");
assertThat(flow.getTargetInputFeature().getFeatureTarget().getName()).isEqualTo("item2");

}).check(input);
}

@Test
@DisplayName("GIVEN a model using a BindingConnectorAsUsage with feature chain, WHEN importing the model, THEN model is correctly imported")
public void checkBindingConnectorWithFeatureChaine() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ private void preResolvingFixingPhase(List<? extends EObject> rootSysmlObjects) {
this.fixConjugatedPorts(root);
this.fixParameterFeatureDirection(root);
this.fixReturnParameterFeatureDirection(root);
this.fixReferenceSubsettingWithNestedFeature(root);
}
this.logger.info("Pre resolving fixing phase done");
}
Expand Down Expand Up @@ -376,8 +377,8 @@ private Membership computePreviousFeatureMembership(Feature testedFeature, java.
return null;
}

private boolean hasImplicitSourceFeature(SuccessionAsUsage successionUsage) {
EList<Feature> ends = successionUsage.getConnectorEnd();
private boolean hasImplicitSourceFeature(SuccessionAsUsage successionAsUsage) {
EList<Feature> ends = successionAsUsage.getConnectorEnd();
if (!ends.isEmpty()) {
Feature sourceEnd = ends.get(0);
return sourceEnd.eClass() == SysmlPackage.eINSTANCE.getFeature() && sourceEnd.getOwnedRelationship().isEmpty();
Expand All @@ -390,8 +391,8 @@ private boolean hasImplicitSourceFeature(TransitionUsage transitionUsage) {
return source == null;
}

private boolean hasImplicitTargetFeature(SuccessionAsUsage successionUsage) {
EList<Feature> ends = successionUsage.getConnectorEnd();
private boolean hasImplicitTargetFeature(SuccessionAsUsage successionAsUsage) {
EList<Feature> ends = successionAsUsage.getConnectorEnd();
if (ends.size() > 1) {
Feature sourceEnd = ends.get(1);
return sourceEnd.eClass() == SysmlPackage.eINSTANCE.getFeature() && sourceEnd.getOwnedRelationship().isEmpty();
Expand Down Expand Up @@ -420,7 +421,7 @@ private JsonNode readAst(final InputStream input) {
public void logTransformationMessages() {
List<Message> messages = this.getTransformationMessages();
if (!messages.isEmpty()) {
String logMessage = messages.stream().map(this::toLogMessage).collect(joining("\n", "Folling messages have been reported during conversion : \n", ""));
String logMessage = messages.stream().map(this::toLogMessage).collect(joining("\n", "Following messages have been reported during conversion: \n", ""));
boolean isError = messages.stream().anyMatch(m -> m.level() == MessageLevel.WARNING || m.level() == MessageLevel.ERROR);
if (isError) {
this.logger.error(logMessage);
Expand All @@ -445,6 +446,7 @@ private void fixFeatureChainReferenceUsage(ReferenceSubsetting referenceSubsetti
referenceSubsetting.getOwnedRelatedElement().stream()
.filter(e -> e.eClass() == SysmlPackage.eINSTANCE.getFeature() && !((Feature) e).getChainingFeature().isEmpty())
.map(Feature.class::cast)
.filter(f -> !f.eIsProxy())
.findFirst()
.ifPresent(referenceSubsetting::setReferencedFeature);
}
Expand Down
40 changes: 40 additions & 0 deletions doc/content/modules/user-manual/pages/release-notes/2025.8.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,46 @@ Type T3 {

The `FeatureChain` _t1Feature.t2Feature_ is now typed with _T3_.

- Fix a name resolution problem during textual import of elements used in a `FlowConnectionAsUsage`.
In the following example, the last segment of the `FlowConnectionAsUsage` ends were not propertly resolved during import.

```
package 'Port Example' {
attribute def Temp;
part def Fuel;
port def FuelOutPort {
attribute temperature : Temp;
out item fuelSupply : Fuel;
in item fuelReturn : Fuel;
}
port def FuelInPort {
attribute temperature : Temp;
in item fuelSupply : Fuel;
out item fuelReturn : Fuel;
}
part def FuelTankAssembly {
port fuelTankPort : FuelOutPort;
}
part def Engine {
port engineFuelPort : FuelInPort;
}
}
package 'Flow Connection Interface Example' {
private import 'Port Example'::*;
part def Vehicle;
part vehicle : Vehicle {
part tankAssy : FuelTankAssembly;
part eng : Engine;
flow of Fuel
from tankAssy.fuelTankPort.fuelSupply // Failed to resolved fuelSupply
to eng.engineFuelPort.fuelSupply; // Failed to resolved fuelSupply
flow of Fuel
from eng.engineFuelPort.fuelReturn // Failed to resolved fuelReturn
to tankAssy.fuelTankPort.fuelReturn; // Failed to resolved fuelReturn
}
}
```

== Improvements

- Align metamodel to {sysmlv2} 2025-04 specification released on April 2025 (see https://www.omg.org/spec/SysML/ for more details) and {kerml} 2025-04 specification released on April 2025 (see https://www.omg.org/spec/KerML/ for more details).
Expand Down
10 changes: 5 additions & 5 deletions scripts/check-coverage.jsh
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ double expectedGlobalCoverage = 65.0;
var moduleCoverageData = List.of(
new ModuleCoverage("syson-sysml-metamodel", 71.0),
new ModuleCoverage("syson-sysml-metamodel-edit", 16.0),
new ModuleCoverage("syson-siriusweb-customnodes-metamodel", 43.0),
new ModuleCoverage("syson-siriusweb-customnodes-metamodel", 47.0),
new ModuleCoverage("syson-siriusweb-customnodes-metamodel-edit", 0.0),
new ModuleCoverage("syson-direct-edit-grammar", 66.0),
new ModuleCoverage("syson-services", 71.0),
new ModuleCoverage("syson-services", 72.0),
new ModuleCoverage("syson-sysml-rest-api-services", 94.0),
new ModuleCoverage("syson-sysml-import", 84.0),
new ModuleCoverage("syson-sysml-export", 63.0),
new ModuleCoverage("syson-sysml-validation", 99.0),
new ModuleCoverage("syson-diagram-common-view", 85.0),
new ModuleCoverage("syson-diagram-common-view", 86.0),
new ModuleCoverage("syson-diagram-general-view", 98.0),
new ModuleCoverage("syson-diagram-actionflow-view", 96.0),
new ModuleCoverage("syson-diagram-statetransition-view", 94.0),
new ModuleCoverage("syson-diagram-interconnection-view", 96.0),
new ModuleCoverage("syson-tree-explorer-view", 74.0),
new ModuleCoverage("syson-application-configuration", 65.0),
new ModuleCoverage("syson-tree-explorer-view", 76.0),
new ModuleCoverage("syson-application-configuration", 66.0),
new ModuleCoverage("syson-application", 37.0)
);

Expand Down