use of org.drools.scenariosimulation.backend.util.ImpossibleToFindDMNException in project drools-wb by kiegroup.
the class ScenarioSimulationServiceImpl method load.
@Override
public ScenarioSimulationModel load(final Path path) {
try {
final String content = ioService.readAllString(Paths.convert(path));
final ScenarioSimulationModel scenarioSimulationModel = unmarshalInternal(content);
final Settings settings = scenarioSimulationModel.getSettings();
if (settings != null && DMN.equals(settings.getType())) {
try {
dmnTypeService.initializeNameAndNamespace(settings, path, settings.getDmnFilePath());
} catch (ImpossibleToFindDMNException e) {
// this error is not thrown so user can fix the file path manually
logger.error(e.getMessage(), e);
}
}
return scenarioSimulationModel;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
use of org.drools.scenariosimulation.backend.util.ImpossibleToFindDMNException in project drools-wb by kiegroup.
the class ScenarioSimulationServiceImplTest method load.
@Test
public void load() {
ScenarioSimulationModel model = service.load(path);
assertEquals(Type.DMN, model.getSettings().getType());
verify(dmnTypeServiceMock, times(1)).initializeNameAndNamespace(any(), any(), any());
doThrow(new ImpossibleToFindDMNException("")).when(dmnTypeServiceMock).initializeNameAndNamespace(any(), any(), any());
try {
service.load(path);
} catch (Exception e) {
fail();
}
}
Aggregations