diff --git a/kerml/src/examples/Simple Tests/Connectors.kerml b/kerml/src/examples/Simple Tests/Connectors.kerml index f76e5b1c9..388414156 100644 --- a/kerml/src/examples/Simple Tests/Connectors.kerml +++ b/kerml/src/examples/Simple Tests/Connectors.kerml @@ -17,6 +17,7 @@ package Connectors { end feature references a; end feature references b; } + binding ab1 : AS of a = b; succession a then b; succession s first a then b; @@ -24,10 +25,19 @@ package Connectors { end feature references a; end feature references b; } + succession s1 : AS first a then b; + } class B { - feature a : A; + feature a : A; connector :> a.c1 from a.a to a.b; } + + assoc struct AS { + end a; + end b; + } + + } \ No newline at end of file diff --git a/org.omg.kerml.xtext/src/org/omg/kerml/xtext/library/KerMLLibraryProvider.xtend b/org.omg.kerml.xtext/src/org/omg/kerml/xtext/library/KerMLLibraryProvider.xtend index f99681b35..f39a12887 100644 --- a/org.omg.kerml.xtext/src/org/omg/kerml/xtext/library/KerMLLibraryProvider.xtend +++ b/org.omg.kerml.xtext/src/org/omg/kerml/xtext/library/KerMLLibraryProvider.xtend @@ -1,6 +1,6 @@ /***************************************************************************** * SysML 2 Pilot Implementation - * Copyright (c) 2019-2020 Model Driven Solutions, Inc. + * Copyright (c) 2019-2020, 2026 Model Driven Solutions, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -44,7 +44,7 @@ class KerMLLibraryProvider implements IModelLibraryProvider { ResourceDescriptionsProvider resourceDescriptionProvider override Element getElement(Element context, String name) { - if (context === null) { + if (context?.eResource()?.getResourceSet() === null || name === null) { return null } else { val qname = nameConverter.toQualifiedName(name) diff --git a/org.omg.sysml.xpect.tests/src/org/omg/sysml/xpect/tests/simpletests/ConnectionTest.sysml.xt b/org.omg.sysml.xpect.tests/src/org/omg/sysml/xpect/tests/simpletests/ConnectionTest.sysml.xt index 663265a75..283f422a5 100644 --- a/org.omg.sysml.xpect.tests/src/org/omg/sysml/xpect/tests/simpletests/ConnectionTest.sysml.xt +++ b/org.omg.sysml.xpect.tests/src/org/omg/sysml/xpect/tests/simpletests/ConnectionTest.sysml.xt @@ -54,9 +54,21 @@ package ConnectionTest { connect p1.x to y; connect p1.x.x1 to y; + + part a; + part b; + + bind a = b; + binding ab bind a = b; + binding ab1 : AB bind a = b; + + first a then b; + succession s first a then b; + succession s1 : AB first a then b; } abstract connection def C { + part p; end end1; end end2; end end3; @@ -77,7 +89,7 @@ package ConnectionTest { connection { part q; - end [2] ref end1 ::> d1 :> q; + end ref end1 ::> d1 :> q; end end2 ::> d2; } @@ -92,7 +104,8 @@ package ConnectionTest { part def B; connection def AB { - end a : A; - end b : B crosses a.b; + end [1] item a : A; + end b : B; } + } diff --git a/org.omg.sysml/src/org/omg/sysml/util/ImplicitGeneralizationMap.java b/org.omg.sysml/src/org/omg/sysml/util/ImplicitGeneralizationMap.java index 88e3f2cf3..50faf53bc 100644 --- a/org.omg.sysml/src/org/omg/sysml/util/ImplicitGeneralizationMap.java +++ b/org.omg.sysml/src/org/omg/sysml/util/ImplicitGeneralizationMap.java @@ -59,6 +59,7 @@ protected ImplicitGeneralizationMap() { //checkBindingConnectorSpecialization put(BindingConnectorImpl.class, "binary", "Links::selfLinks"); + put(BindingConnectorImpl.class, "binaryObject", "Links::selfLinks"); //checkBooleanExpressionSpecialization put(BooleanExpressionImpl.class, "base", "Performances::booleanEvaluations"); @@ -202,6 +203,7 @@ protected ImplicitGeneralizationMap() { //checkSuccessionSpecialization put(SuccessionImpl.class, "binary", "Occurrences::happensBeforeLinks"); + put(SuccessionImpl.class, "binaryObject", "Occurrences::happensBeforeLinks"); //checkSuccessionSpecialization put(SuccessionFlowImpl.class, "base", "Transfers::flowTransfersBefore"); @@ -285,6 +287,7 @@ protected ImplicitGeneralizationMap() { put(BindingConnectorAsUsageImpl.class, "base", "Links::selfLinks"); //checkBindingConnectorSpecialization put(BindingConnectorAsUsageImpl.class, "binary", "Links::selfLinks"); + put(BindingConnectorAsUsageImpl.class, "binaryObject", "Links::selfLinks"); //checkCalculationDefinitionSpecialization put(CalculationDefinitionImpl.class, "base", "Calculations::Calculation"); @@ -511,6 +514,7 @@ protected ImplicitGeneralizationMap() { put(SuccessionAsUsageImpl.class, "base", "Occurrences::happensBeforeLinks"); //checkSuccessionSpecialization put(SuccessionAsUsageImpl.class, "binary", "Occurrences::happensBeforeLinks"); + put(SuccessionAsUsageImpl.class, "binaryObject", "Occurrences::happensBeforeLinks"); //checkDecisionNodeOutgoingSuccessionSpecialization put(SuccessionAsUsageImpl.class, "decision", "ControlPerformances::DecisionPerformance::outgoingHBLink"); //checkMergeNodeIncomingSuccessionSpecialization diff --git a/sysml/src/examples/Simple Tests/ConnectionTest.sysml b/sysml/src/examples/Simple Tests/ConnectionTest.sysml index eae376821..1cfb9df6a 100644 --- a/sysml/src/examples/Simple Tests/ConnectionTest.sysml +++ b/sysml/src/examples/Simple Tests/ConnectionTest.sysml @@ -15,6 +15,17 @@ package ConnectionTest { connect p1.x to y; connect p1.x.x1 to y; + + part a; + part b; + + bind a = b; + binding ab bind a = b; + binding ab1 : AB bind a = b; + + first a then b; + succession s first a then b; + succession s1 : AB first a then b; } abstract connection def C { @@ -61,4 +72,6 @@ package ConnectionTest { } metadata def M; + + } \ No newline at end of file