use of org.kie.internal.builder.ScoreCardConfiguration in project drools by kiegroup.
the class ScorecardProviderTest method testDrlGenerationWithExternalTypes.
@Test
public void testDrlGenerationWithExternalTypes() throws Exception {
InputStream is = ScorecardProviderTest.class.getResourceAsStream("/scoremodel_externalmodel.xls");
assertNotNull(is);
ScoreCardConfiguration scconf = KnowledgeBuilderFactory.newScoreCardConfiguration();
scconf.setWorksheetName("scorecards");
scconf.setUsingExternalTypes(true);
String drl = scoreCardProvider.loadFromInputStream(is, scconf);
assertNotNull(drl);
assertTrue(drl.length() > 0);
assertTrue(drl.contains("org.drools.scorecards.example.Applicant"));
}
use of org.kie.internal.builder.ScoreCardConfiguration in project drools by kiegroup.
the class ScorecardProviderTest method testDrlWithSheetName.
@Test
public void testDrlWithSheetName() throws Exception {
InputStream is = ScorecardProviderTest.class.getResourceAsStream("/scoremodel_c.xls");
assertNotNull(is);
ScoreCardConfiguration scconf = KnowledgeBuilderFactory.newScoreCardConfiguration();
scconf.setWorksheetName("scorecards");
drl = scoreCardProvider.loadFromInputStream(is, scconf);
assertNotNull(drl);
assertTrue(drl.length() > 0);
}
use of org.kie.internal.builder.ScoreCardConfiguration in project drools by kiegroup.
the class ScorecardProviderTest method testDrlWithoutSheetName.
@Test
public void testDrlWithoutSheetName() throws Exception {
InputStream is = ScorecardProviderTest.class.getResourceAsStream("/scoremodel_c.xls");
assertNotNull(is);
ScoreCardConfiguration scconf = KnowledgeBuilderFactory.newScoreCardConfiguration();
drl = scoreCardProvider.loadFromInputStream(is, scconf);
assertNotNull(drl);
assertTrue(drl.length() > 0);
// System.out.println(drl);
}
use of org.kie.internal.builder.ScoreCardConfiguration in project drools by kiegroup.
the class KnowledgeBuilderImpl method scoreCardToPackageDescr.
PackageDescr scoreCardToPackageDescr(Resource resource, ResourceConfiguration configuration) throws DroolsParserException, IOException {
ScoreCardConfiguration scardConfiguration = configuration instanceof ScoreCardConfiguration ? (ScoreCardConfiguration) configuration : null;
String string = ScoreCardFactory.loadFromInputStream(resource.getInputStream(), scardConfiguration);
return generatedDrlToPackageDescr(resource, string);
}
use of org.kie.internal.builder.ScoreCardConfiguration in project drools by kiegroup.
the class ScorecardProviderPMMLTest method testDrlGeneration.
@Test
public void testDrlGeneration() throws Exception {
InputStream is = ScorecardProviderPMMLTest.class.getResourceAsStream("/SimpleScorecard.pmml");
assertNotNull(is);
ScoreCardConfiguration scconf = KnowledgeBuilderFactory.newScoreCardConfiguration();
scconf.setInputType(SCORECARD_INPUT_TYPE.PMML);
drl = scoreCardProvider.loadFromInputStream(is, scconf);
assertNotNull(drl);
assertTrue(drl.length() > 0);
}
Aggregations