Search in sources :

Example 1 with AbstractScorecardParser

use of org.drools.scorecards.parser.AbstractScorecardParser in project drools by kiegroup.

the class ScorecardCompiler method compileFromExcel.

public boolean compileFromExcel(final InputStream stream, final String worksheetName) {
    try {
        AbstractScorecardParser parser = new XLSScorecardParser();
        scorecardErrors = parser.parseFile(stream, worksheetName);
        if (scorecardErrors.isEmpty()) {
            pmmlDocument = parser.getPMMLDocument();
            return true;
        }
    } catch (ScorecardParseException e) {
        logger.error(e.getMessage(), e);
    } finally {
        closeStream(stream);
    }
    return false;
}
Also used : AbstractScorecardParser(org.drools.scorecards.parser.AbstractScorecardParser) XLSScorecardParser(org.drools.scorecards.parser.xls.XLSScorecardParser) ScorecardParseException(org.drools.scorecards.parser.ScorecardParseException)

Aggregations

AbstractScorecardParser (org.drools.scorecards.parser.AbstractScorecardParser)1 ScorecardParseException (org.drools.scorecards.parser.ScorecardParseException)1 XLSScorecardParser (org.drools.scorecards.parser.xls.XLSScorecardParser)1