@@ -1079,7 +1079,7 @@ class SysMLValidator extends KerMLValidator {
10791079 checkAtMostOneFeature(defn, SubjectMembership , INVALID_REQUIREMENT_DEFINITION_ONLY_ONE_SUBJECT_MSG , INVALID_REQUIREMENT_DEFINITION_ONLY_ONE_SUBJECT )
10801080
10811081 // validateRequirementDefinitionSubjectParameterPosition
1082- checkSubjectParameter(defn, defn . subjectParameter, defn . input, INVALID_REQUIREMENT_DEFINITION_SUBJECT_PARAMETER_POSITION_MSG , INVALID_REQUIREMENT_DEFINITION_SUBJECT_PARAMETER_POSITION )
1082+ checkSubjectParameter(defn, INVALID_REQUIREMENT_DEFINITION_SUBJECT_PARAMETER_POSITION_MSG , INVALID_REQUIREMENT_DEFINITION_SUBJECT_PARAMETER_POSITION )
10831083 }
10841084
10851085 @Check
@@ -1091,7 +1091,7 @@ class SysMLValidator extends KerMLValidator {
10911091 checkAtMostOneFeature(usg, SubjectMembership , INVALID_REQUIREMENT_USAGE_ONLY_ONE_SUBJECT_MSG , INVALID_REQUIREMENT_USAGE_ONLY_ONE_SUBJECT )
10921092
10931093 // validateRequirementUsageSubjectParameterPosition
1094- checkSubjectParameter(usg, usg . subjectParameter, usg . input, INVALID_REQUIREMENT_USAGE_SUBJECT_PARAMETER_POSITION_MSG , INVALID_REQUIREMENT_USAGE_SUBJECT_PARAMETER_POSITION )
1094+ checkSubjectParameter(usg, INVALID_REQUIREMENT_USAGE_SUBJECT_PARAMETER_POSITION_MSG , INVALID_REQUIREMENT_USAGE_SUBJECT_PARAMETER_POSITION )
10951095 }
10961096
10971097 @Check
@@ -1129,7 +1129,7 @@ class SysMLValidator extends KerMLValidator {
11291129 checkAtMostOneFeature(defn, SubjectMembership , INVALID_CASE_DEFINITION_ONLY_ONE_SUBJECT_MSG , INVALID_CASE_DEFINITION_ONLY_ONE_SUBJECT )
11301130
11311131 // validateCaseDefinitionSubjectParameterPosition
1132- checkSubjectParameter(defn, defn . subjectParameter, defn . input, INVALID_CASE_DEFINITION_SUBJECT_PARAMETER_POSITION_MSG , INVALID_CASE_DEFINITION_SUBJECT_PARAMETER_POSITION )
1132+ checkSubjectParameter(defn, INVALID_CASE_DEFINITION_SUBJECT_PARAMETER_POSITION_MSG , INVALID_CASE_DEFINITION_SUBJECT_PARAMETER_POSITION )
11331133 }
11341134
11351135 @Check
@@ -1145,7 +1145,7 @@ class SysMLValidator extends KerMLValidator {
11451145 checkAtMostOneFeature(usg, SubjectMembership , INVALID_CASE_USAGE_ONLY_ONE_SUBJECT_MSG , INVALID_CASE_USAGE_ONLY_ONE_SUBJECT )
11461146
11471147 // validateCaseUsageSubjectParameterPosition
1148- checkSubjectParameter(usg, usg . subjectParameter, usg . input, INVALID_CASE_USAGE_SUBJECT_PARAMETER_POSITION_MSG , INVALID_CASE_USAGE_SUBJECT_PARAMETER_POSITION )
1148+ checkSubjectParameter(usg, INVALID_CASE_USAGE_SUBJECT_PARAMETER_POSITION_MSG , INVALID_CASE_USAGE_SUBJECT_PARAMETER_POSITION )
11491149 }
11501150
11511151 @Check
@@ -1390,9 +1390,11 @@ class SysMLValidator extends KerMLValidator {
13901390 return true
13911391 }
13921392
1393- protected def boolean checkSubjectParameter (Type type , Feature subjectParameter , Iterable<Feature > inputs , String msg , String eId ) {
1394- if (subjectParameter !== null && (inputs. empty || inputs. get(0 ) !== subjectParameter)) {
1395- if (subjectParameter. owningType == = type) {
1393+ protected def boolean checkSubjectParameter (Type type , String msg , String eId ) {
1394+ val inputs = type. input
1395+ if (inputs. empty || ! UsageUtil . isSubjectParameter(inputs. get(0 ))) {
1396+ val subjectParameter = UsageUtil . getOwnedSubjectParameterOf(type)
1397+ if (subjectParameter !== null ) {
13961398 error(msg, subjectParameter, null , eId)
13971399 } else {
13981400 error(msg, type, null , eId)
0 commit comments