Search in sources :

Example 1 with KiePMMLCharacteristics

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);
    }
}
Also used : KiePMMLCharacteristics(org.kie.pmml.models.scorecard.model.KiePMMLCharacteristics) KiePMMLException(org.kie.pmml.api.exceptions.KiePMMLException) KiePMMLInternalException(org.kie.pmml.api.exceptions.KiePMMLInternalException) KiePMMLException(org.kie.pmml.api.exceptions.KiePMMLException)

Example 2 with KiePMMLCharacteristics

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);
}
Also used : KiePMMLCharacteristics(org.kie.pmml.models.scorecard.model.KiePMMLCharacteristics) Scorecard(org.dmg.pmml.scorecard.Scorecard) HasClassLoaderMock(org.kie.pmml.compiler.commons.mocks.HasClassLoaderMock) Test(org.junit.Test)

Aggregations

KiePMMLCharacteristics (org.kie.pmml.models.scorecard.model.KiePMMLCharacteristics)2 Scorecard (org.dmg.pmml.scorecard.Scorecard)1 Test (org.junit.Test)1 KiePMMLException (org.kie.pmml.api.exceptions.KiePMMLException)1 KiePMMLInternalException (org.kie.pmml.api.exceptions.KiePMMLInternalException)1 HasClassLoaderMock (org.kie.pmml.compiler.commons.mocks.HasClassLoaderMock)1