use of org.osate.aadl2.modelsupport.errorreporting.QueuingAnalysisErrorReporter in project AGREE by loonwerks.
the class VerifyHandler method getSysInstance.
protected SystemInstance getSysInstance(ComponentImplementation ci, EphemeralImplementationUtil implUtil) {
try {
AnalysisErrorReporterManager errorManager = new AnalysisErrorReporterManager(QueuingAnalysisErrorReporter.factory);
SystemInstance result = implUtil.generateEphemeralCompInstanceFromImplementation(ci);
QueuingAnalysisErrorReporter errorReporter = (QueuingAnalysisErrorReporter) errorManager.getReporter(result.eResource());
StringBuilder stringBuilder = new StringBuilder();
List<Message> instantiationMarkers = errorReporter.getErrors();
if (!instantiationMarkers.isEmpty()) {
instantiationMarkers.stream().forEach(marker -> {
stringBuilder.append(marker.message);
});
throw new AgreeException(stringBuilder.toString());
}
return result;
} catch (Exception e) {
Dialog.showError("Model Instantiate", "Error while re-instantiating the model: " + e.getMessage());
throw new AgreeException("Error Instantiating model");
}
}
Aggregations