use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class ErrorSourceImpl method setFailureModeReference.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setFailureModeReference(ErrorBehaviorState newFailureModeReference) {
ErrorBehaviorState oldFailureModeReference = failureModeReference;
failureModeReference = newFailureModeReference;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_SOURCE__FAILURE_MODE_REFERENCE, oldFailureModeReference, failureModeReference));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class ErrorBehaviorTransitionImpl method setSource.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setSource(ErrorBehaviorState newSource) {
ErrorBehaviorState oldSource = source;
source = newSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_BEHAVIOR_TRANSITION__SOURCE, oldSource, source));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class ErrorBehaviorTransitionImpl method setTarget.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTarget(ErrorBehaviorState newTarget) {
ErrorBehaviorState oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_BEHAVIOR_TRANSITION__TARGET, oldTarget, target));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class CompositeStateImpl method setState.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setState(ErrorBehaviorState newState) {
ErrorBehaviorState oldState = state;
state = newState;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.COMPOSITE_STATE__STATE, oldState, state));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class ErrorModelValidator method checkTransitionTargetTriggerTypes.
private void checkTransitionTargetTriggerTypes(ErrorBehaviorTransition ebt) {
if (ebt.isSteadyState()) {
return;
}
ErrorBehaviorState targetstate = ebt.getTarget();
if (targetstate != null) {
TypeSet targetTS = targetstate.getTypeSet();
if (targetTS == null) {
return;
}
TypeSet tt = ebt.getTargetToken();
if (tt != null) {
return;
}
// state requires a type
if (ebt.getCondition() instanceof ConditionElement) {
// either the event must be typed or the source state must be typed
EventOrPropagation ep = EMV2Util.getErrorEventOrPropagation((ConditionElement) ebt.getCondition());
if (ep instanceof ErrorEvent) {
ErrorEvent ev = (ErrorEvent) ep;
TypeSet evTS = ev.getTypeSet();
if (evTS == null) {
TypeSet srcTS = ebt.getSource().getTypeSet();
if (srcTS == null) {
error(ebt, "Target state " + targetstate.getName() + " requires type but the triggering error event " + EMV2Util.getPrintName(ev) + " or source state " + EMV2Util.getPrintName(ebt.getSource()) + " does not have a type");
} else {
// source typeset must be contained in target type set
if (!EMV2TypeSetUtil.contains(targetTS, srcTS)) {
error(ebt, "Target state " + targetstate.getName() + " does not contain types of source state " + EMV2Util.getPrintName(ebt.getSource()));
}
}
} else {
// error event has type. It must be consistent with the expected state type
if (!EMV2TypeSetUtil.contains(targetTS, evTS)) {
error(ebt, "Target state " + targetstate.getName() + " does not contain types of error event " + EMV2Util.getPrintName(ev));
}
}
} else if (ep instanceof ErrorPropagation) {
ErrorPropagation eprop = (ErrorPropagation) ep;
// we can check type compatibility
if (!EMV2TypeSetUtil.contains(targetTS, eprop.getTypeSet())) {
error(ebt, "Target state " + targetstate.getName() + " does not contain types of error propagation " + EMV2Util.getPrintName(eprop));
}
}
} else {
// full condition expression
// type transformation & events must be typed
ErrorBehaviorStateMachine ebsm = (ErrorBehaviorStateMachine) targetstate.eContainer();
if (ebsm.getUseTransformation().isEmpty()) {
error(ebt, "Target state " + targetstate.getName() + " does not include a target type but requires types. For conditions on multiple elements a target type must be assigned explicitly or a type transformation must be specified in the error behavior state machine" + EMV2Util.getPrintName(ebsm));
}
}
}
}
Aggregations