use of org.drools.decisiontable.SpreadsheetCompiler in project drools-wb by kiegroup.
the class DecisionTableXLSServiceImpl method getSource.
@Override
public String getSource(final Path path) {
InputStream inputStream = null;
try {
final SpreadsheetCompiler compiler = new SpreadsheetCompiler();
inputStream = ioService.newInputStream(Paths.convert(path), StandardOpenOption.READ);
final String drl = compiler.compile(inputStream, InputType.XLS);
return drl;
} catch (Exception e) {
throw new SourceGenerationFailedException(e.getMessage());
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException ioe) {
throw ExceptionUtilities.handleException(ioe);
}
}
}
}
Aggregations