Skip to content

Commit 2f7a5e3

Browse files
committed
KERML_-1 Implemented check for validateRedefinitionEndConformance.
- Also updated ControlPerformances to remove validation errors.
1 parent 9caaa30 commit 2f7a5e3

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

org.omg.kerml.xpect.tests/library/ControlPerformances.kerml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ standard library package ControlPerformances {
3131
* successions going out of a decision step.
3232
*/
3333

34-
feature redefines earlierOccurrence subsets that;
34+
end feature redefines earlierOccurrence subsets that;
3535
}
3636
}
3737

@@ -52,7 +52,7 @@ standard library package ControlPerformances {
5252
* successions coming into a merge step.
5353
*/
5454

55-
feature redefines laterOccurrence subsets that;
55+
end feature redefines laterOccurrence subsets that;
5656
}
5757
}
5858

org.omg.kerml.xtext/src/org/omg/kerml/xtext/validation/KerMLValidator.xtend

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ class KerMLValidator extends AbstractKerMLValidator {
180180

181181
public static val INVALID_REDEFINITION_DIRECTION_CONFORMANCE = "validateRedefinitionDirectionConformance"
182182
public static val INVALID_REDEFINITION_DIRECTION_CONFORMANCE_MSG = "Redefining feature must have a compatible direction"
183+
public static val INVALID_REDEFINITION_END_CONFORMANCE = "validateRedefinitionEndConformance"
184+
public static val INVALID_REDEFINITION_END_CONFORMANCE_MSG = "Redefining feature must be an end feature"
183185
public static val INVALID_REDEFINITION_FEATURING_TYPES = 'validateRedefinitionFeaturingTypes'
184186
public static val INVALID_REDEFINITION_FEATURING_TYPES_MSG_1 = "A package-level feature cannot be redefined"
185187
public static val INVALID_REDEFINITION_FEATURING_TYPES_MSG_2 = "Owner of redefining feature cannot be the same as owner of redefined feature"
@@ -601,6 +603,13 @@ class KerMLValidator extends AbstractKerMLValidator {
601603
SysMLPackage.eINSTANCE.redefinition_RedefinedFeature, INVALID_REDEFINITION_FEATURING_TYPES)
602604
}
603605
}
606+
607+
// validatRedefinitionEndConformance
608+
609+
if (redefinedFeature.isEnd && !redefiningFeature.isEnd) {
610+
error(INVALID_REDEFINITION_END_CONFORMANCE_MSG, redef,
611+
SysMLPackage.eINSTANCE.redefinition_RedefinedFeature, INVALID_REDEFINITION_END_CONFORMANCE)
612+
}
604613
}
605614
}
606615

sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ standard library package ControlPerformances {
3131
* successions going out of a decision step.
3232
*/
3333

34-
feature redefines earlierOccurrence subsets that;
34+
end feature redefines earlierOccurrence subsets that;
3535
}
3636
}
3737

@@ -52,7 +52,7 @@ standard library package ControlPerformances {
5252
* successions coming into a merge step.
5353
*/
5454

55-
feature redefines laterOccurrence subsets that;
55+
end feature redefines laterOccurrence subsets that;
5656
}
5757
}
5858

0 commit comments

Comments
 (0)