Skip to content

Commit b88e84c

Browse files
committed
ST6RI-897 Moved non-gen code for FlowUsage.isAbstract to adapter.
1 parent 2328589 commit b88e84c

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

org.omg.sysml.xpect.tests/src/org/omg/sysml/xpect/tests/validation/invalid/Relationship_invalid_relatedElement1.sysml.xt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ package 'Streaming Example' {
4949
"Cannot identify flow end (use dot notation)" at "C::myIn"
5050
"Must be an accessible feature (use dot notation for nesting)" at "B::myOut"
5151
"Must be an accessible feature (use dot notation for nesting)" at "C::myIn"
52+
"Must have at least two related elements" at "flow XXX from B::myOut to C::myIn;"
5253
--- */
5354
flow XXX from B::myOut to C::myIn;
5455
}

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2021-2025 Model Driven Solutions, Inc.
3+
* Copyright (c) 2021-2026 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -99,9 +99,22 @@ protected String getDefaultSupertype() {
9999
getDefaultSupertype("base");
100100
}
101101

102+
/**
103+
* @satisfies validateConnectorRelatedFeatures
104+
* (For a FlowUsage that is a message.)
105+
*/
106+
protected void makeMessageAbstract() {
107+
super.postProcess();
108+
FlowUsage target = getTarget();
109+
if (UsageUtil.isMessageConnection(target) && target.getRelatedFeature().size() < 2) {
110+
target.setIsAbstract(true);
111+
}
112+
}
113+
102114
@Override
103115
public void doTransform() {
104116
ConnectorUtil.transformConnectorEndsOf(getTarget());
117+
makeMessageAbstract();
105118
super.doTransform();
106119
}
107120

org.omg.sysml/syntax-gen/org/omg/sysml/lang/sysml/impl/FlowUsageImpl.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2022, 2024 Model Driven Solutions, Inc.
3+
* Copyright (c) 2022, 2024, 2026 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -637,21 +637,6 @@ public boolean isSubactionUsage() {
637637
}
638638
}
639639

640-
// Additional overrides
641-
642-
/**
643-
* @generated NOT
644-
*/
645-
@Override
646-
public boolean isAbstract() {
647-
if (getRelatedFeature().size() < 2) {
648-
isAbstract = true;
649-
}
650-
return super.isAbstract();
651-
}
652-
653-
//
654-
655640
/**
656641
* <!-- begin-user-doc -->
657642
* <!-- end-user-doc -->

0 commit comments

Comments
 (0)