@@ -334,6 +334,8 @@ class SysMLValidator extends KerMLValidator {
334334 public static val INVALID_TRANSITION_USAGE_PARAMETERS_MSG_2 = " Must have two input parameters."
335335 public static val INVALID_TRANSITION_USAGE_SUCCESSION = " validateTransitionUsageSuccession"
336336 public static val INVALID_TRANSITION_USAGE_SUCCESSION_MSG = " A transition must own a succession to its target."
337+ public static val INVALID_TRANSITION_USAGE_TRIGGER_ACTIONS = " validateTransitionUsageTriggerActions"
338+ public static val INVALID_TRANSITION_USAGE_TRIGGER_ACTIONS_MSG = " A transition with an accepter must have a state as its source."
337339
338340 public static val INVALID_CALCULATION_USAGE_TYPE = " validateCalculationUsageType_"
339341 public static val INVALID_CALCULATION_USAGE_TYPE_MSG = " A calculation must be typed by one calculation definition."
@@ -954,6 +956,14 @@ class SysMLValidator extends KerMLValidator {
954956 if (! (mem. transitionFeature instanceof AcceptActionUsage )) {
955957 error(INVALID_TRANSITION_FEATURE_MEMBERSHIP_TRIGGER_ACTION_MSG , mem, null , INVALID_TRANSITION_FEATURE_MEMBERSHIP_TRIGGER_ACTION )
956958 }
959+ // // validateTransitionUsageTriggerActions
960+ // val owningType = mem.owningType
961+ // if (owningType instanceof TransitionUsage) {
962+ // val source = owningType.source
963+ // if (source !== null && !(source instanceof StateUsage) && !owningType.triggerAction.empty) {
964+ // error(INVALID_TRANSITION_USAGE_TRIGGER_ACTIONS_MSG, mem, null, INVALID_TRANSITION_USAGE_TRIGGER_ACTIONS)
965+ // }
966+ // }
957967 }
958968
959969 // validateTransitionFeatureMembershipOwningType
@@ -976,7 +986,8 @@ class SysMLValidator extends KerMLValidator {
976986
977987 // validateTransitionUsageParameters
978988 val n = usg. inputParameters. size
979- if (usg. triggerAction. isEmpty) {
989+ val triggerAction = usg. triggerAction
990+ if (triggerAction. isEmpty) {
980991 if (n < 1 ) {
981992 error(INVALID_TRANSITION_USAGE_PARAMETERS_MSG_1 , usg, null , INVALID_TRANSITION_USAGE_PARAMETERS )
982993 }
@@ -991,6 +1002,13 @@ class SysMLValidator extends KerMLValidator {
9911002 if (successions. empty || ! (successions. get(0 ) as Succession ). targetFeature. forall[f | FeatureUtil . getBasicFeatureOf(f) instanceof ActionUsage ]) {
9921003 error(INVALID_TRANSITION_USAGE_SUCCESSION_MSG , usg, null , INVALID_TRANSITION_USAGE_SUCCESSION )
9931004 }
1005+
1006+ // validateTransitionUsageTriggerActions
1007+ val source = usg. source
1008+ val mem = usg. ownedMembership. filter(TransitionFeatureMembership ). filter[kind == TransitionFeatureKind . TRIGGER ]. head
1009+ if (source !== null && ! (source instanceof StateUsage ) && mem !== null ) {
1010+ error(INVALID_TRANSITION_USAGE_TRIGGER_ACTIONS_MSG , mem, null , INVALID_TRANSITION_USAGE_TRIGGER_ACTIONS )
1011+ }
9941012 }
9951013
9961014 @Check
0 commit comments