use of org.kie.pmml.models.scorecard.model.KiePMMLCharacteristics in project drools by kiegroup.
the class KiePMMLCharacteristicsFactory method getKiePMMLCharacteristics.
public static KiePMMLCharacteristics getKiePMMLCharacteristics(final ScorecardCompilationDTO compilationDTO) {
logger.trace("getKiePMMLCharacteristics {} {}", compilationDTO.getPackageName(), compilationDTO.getCharacteristics());
final Map<String, String> sourcesMap = getKiePMMLCharacteristicsSourcesMap(compilationDTO);
try {
Class<?> kiePMMLCharacteristicsClass = compilationDTO.compileAndLoadCharacteristicsClass(sourcesMap);
return (KiePMMLCharacteristics) kiePMMLCharacteristicsClass.newInstance();
} catch (Exception e) {
throw new KiePMMLException(e);
}
}
use of org.kie.pmml.models.scorecard.model.KiePMMLCharacteristics in project drools by kiegroup.
the class KiePMMLCharacteristicsFactoryTest method getKiePMMLCharacteristics.
@Test
public void getKiePMMLCharacteristics() {
final CommonCompilationDTO<Scorecard> source = CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME, basicComplexPartialScorePmml, basicComplexPartialScore, new HasClassLoaderMock());
final KiePMMLCharacteristics retrieved = KiePMMLCharacteristicsFactory.getKiePMMLCharacteristics(ScorecardCompilationDTO.fromCompilationDTO(source));
assertNotNull(retrieved);
}
Aggregations