Skip to content

Commit 627e8dc

Browse files
committed
ST6RI-864 Satisfied checkFlowSpecialization for flows with no ends.
1 parent fa99167 commit 627e8dc

4 files changed

Lines changed: 29 additions & 7 deletions

File tree

kerml/src/examples/Simple Tests/Behaviors.kerml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ package Behaviors {
1313
class C {
1414
var z = A().y;
1515
step a : A;
16+
step b : B;
1617
binding z = a.y;
18+
flow a.y to b.x1;
1719
}
20+
abstract flow msg of C;
1821
}

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/parsing/ParsingTests_Behaviors.kerml.xt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
55
File {from ="/library/Base.kerml"}
66
File {from ="/library/Links.kerml"}
77
File {from ="/library/Occurrences.kerml"}
8+
File {from ="/library/Objects.kerml"}
89
File {from ="/library/Performances.kerml"}
10+
File {from ="/library/Transfers.kerml"}
911
File {from ="/library/ControlFunctions.kerml"}
1012
}
1113
Workspace {
@@ -15,7 +17,9 @@ XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
1517
File {from ="/library/Base.kerml"}
1618
File {from ="/library/Links.kerml"}
1719
File {from ="/library/Occurrences.kerml"}
20+
File {from ="/library/Objects.kerml"}
1821
File {from ="/library/Performances.kerml"}
22+
File {from ="/library/Transfers.kerml"}
1923
File {from ="/library/ControlFunctions.kerml"}
2024
}
2125
}
@@ -34,6 +38,14 @@ package Behaviors {
3438
}
3539
behavior B specializes A {
3640
in x1;
37-
out y1;
41+
out var y1;
3842
}
43+
class C {
44+
var z = A().y;
45+
step a : A;
46+
step b : B;
47+
binding z = a.y;
48+
flow a.y to b.x1;
49+
}
50+
abstract flow msg of C;
3951
}

org.omg.sysml/src/org/omg/sysml/adapter/FlowAdapter.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@ public void addDefaultGeneralType() {
5454
}
5555
}
5656

57+
/**
58+
* @satisfies checkFlowSpecialization
59+
* @satisfies checkFlowWithEndsSpecialization
60+
*/
5761
@Override
5862
protected String getDefaultSupertype() {
59-
return getDefaultSupertype("base");
63+
return isFlowTransfer()? getDefaultSupertype("flow"):
64+
getDefaultSupertype("base");
65+
}
66+
67+
protected boolean isFlowTransfer() {
68+
return !getTarget().getOwnedEndFeature().isEmpty();
6069
}
6170

6271
@Override

org.omg.sysml/src/org/omg/sysml/util/ImplicitGeneralizationMap.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,10 @@ protected ImplicitGeneralizationMap() {
124124
//checkPayloadFeatureRedefinition
125125
put(PayloadFeatureImpl.class, "payload", "Transfers::Transfer::payload");
126126

127-
/*
128-
* TODO: checkFlowSpecialization
129-
* specializesFromLibrary('Transfers::transfers')
130-
*/
127+
//checkFlowSpecialization
128+
put(FlowImpl.class, "base", "Transfers::transfers");
131129
//checkFlowWithEndsSpecialization
132-
put(FlowImpl.class, "base", "Transfers::flowTransfers");
130+
put(FlowImpl.class, "flow", "Transfers::flowTransfers");
133131
//checkStepEnclosedPerformanceSpecialization
134132
put(FlowImpl.class, "enclosedPerformance", "Performances::Performance::enclosedPerformances");
135133
//checkStepSubperformanceSpecialization

0 commit comments

Comments
 (0)