use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelSubclause in project osate2 by osate.
the class EMV2Util method getAllErrorDetections.
/**
* return list of OutgoingPropagationCondition including those inherited from classifiers being extended
* @param cl Classifier
* @param unnamed Collection of unnamed OutgoingPropagationCondition
* @return Collection<ErrorBehaviorTransition> list of OutgoingPropagationCondition as HashMap for quick lookup of names
*/
public static HashMap<String, ErrorDetection> getAllErrorDetections(Classifier cl, Collection<ErrorDetection> unnamed) {
HashMap<String, ErrorDetection> result = new LinkedHashMap<>();
EList<ErrorModelSubclause> emslist = getAllContainingClassifierEMV2Subclauses(cl);
for (ErrorModelSubclause errorModelSubclause : emslist) {
EList<ErrorDetection> eflist = errorModelSubclause.getErrorDetections();
for (ErrorDetection ebt : eflist) {
if (ebt.getName() == null) {
unnamed.add(ebt);
} else {
if (!result.containsKey(ebt.getName())) {
result.put(ebt.getName(), ebt);
}
}
}
}
return result;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelSubclause in project osate2 by osate.
the class EMV2Util method getAllErrorFlows.
/**
* return list of error flow including those inherited from classifiers being extended
* @param cl Classifier
* @return Collection<ErrorFlow> list of error flow
*/
public static Collection<ErrorFlow> getAllErrorFlows(Classifier cl) {
HashMap<String, ErrorFlow> result = new LinkedHashMap<>();
EList<ErrorModelSubclause> emslist = getAllContainingClassifierEMV2Subclauses(cl);
for (ErrorModelSubclause errorModelSubclause : emslist) {
EList<ErrorFlow> eflist = errorModelSubclause.getFlows();
for (ErrorFlow errorFlow : eflist) {
if (!result.containsKey(errorFlow.getName())) {
result.put(errorFlow.getName(), errorFlow);
}
}
}
return result.values();
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelSubclause in project osate2 by osate.
the class EMV2Util method getAllErrorSources.
/**
* return list of error sources including those inherited from classifiers being extended
* @param cl Classifier
* @return Collection<ErrorSource> list of error flow
*/
public static Collection<ErrorSource> getAllErrorSources(Classifier cl) {
HashMap<String, ErrorSource> result = new LinkedHashMap<>();
EList<ErrorModelSubclause> emslist = getAllContainingClassifierEMV2Subclauses(cl);
for (ErrorModelSubclause errorModelSubclause : emslist) {
EList<ErrorFlow> eflist = errorModelSubclause.getFlows();
for (ErrorFlow errorFlow : eflist) {
if (errorFlow instanceof ErrorSource) {
if (!result.containsKey(errorFlow.getName())) {
result.put(errorFlow.getName(), (ErrorSource) errorFlow);
}
}
}
}
return result.values();
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelSubclause in project osate2 by osate.
the class EMV2Util method getAllOutgoingPropagationConditions.
/**
* return list of OutgoingPropagationCondition including those inherited from classifiers being extended
* @param cl Classifier
* @param unnamed Collection of unnamed OutgoingPropagationCondition
* @return Collection<ErrorBehaviorTransition> list of OutgoingPropagationCondition as HashMap for quick lookup of names
*/
private static HashMap<String, OutgoingPropagationCondition> getAllOutgoingPropagationConditions(Classifier cl, Collection<OutgoingPropagationCondition> unnamed) {
HashMap<String, OutgoingPropagationCondition> result = new LinkedHashMap<>();
EList<ErrorModelSubclause> emslist = getAllContainingClassifierEMV2Subclauses(cl);
for (ErrorModelSubclause errorModelSubclause : emslist) {
EList<OutgoingPropagationCondition> eflist = errorModelSubclause.getOutgoingPropagationConditions();
for (OutgoingPropagationCondition ebt : eflist) {
if (ebt.getName() == null) {
unnamed.add(ebt);
} else {
if (!result.containsKey(ebt.getName())) {
result.put(ebt.getName(), ebt);
}
}
}
}
return result;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelSubclause in project osate2 by osate.
the class EMV2Util method getAllErrorBehaviorEvents.
/**
* return list of ErrorBehaviorEvents including those inherited from classifiers being extended
* @param cl Classifier
* @return Collection<ErrorBehaviorEvent> list of ErrorBehaviorEvents as HashMap for quick lookup of names
*/
public static Collection<ErrorBehaviorEvent> getAllErrorBehaviorEvents(Classifier cl) {
HashMap<String, ErrorBehaviorEvent> result = new LinkedHashMap<>();
EList<ErrorModelSubclause> emslist = getAllContainingClassifierEMV2Subclauses(cl);
boolean foundEBSM = false;
for (ErrorModelSubclause errorModelSubclause : emslist) {
ErrorBehaviorStateMachine ebsm = errorModelSubclause.getUseBehavior();
EList<ErrorBehaviorEvent> eflist = errorModelSubclause.getEvents();
for (ErrorBehaviorEvent ebe : eflist) {
if (!result.containsKey(ebe.getName())) {
result.put(ebe.getName(), ebe);
}
}
if (!foundEBSM && ebsm != null) {
foundEBSM = true;
eflist = ebsm.getEvents();
for (ErrorBehaviorEvent ebe : eflist) {
if (!result.containsKey(ebe.getName())) {
result.put(ebe.getName(), ebe);
}
}
}
}
return result.values();
}
Aggregations