use of org.kie.pmml.evaluator.core.executor.PMMLModelEvaluator in project drools by kiegroup.
the class PMMLRuntimeInternalImpl method evaluate.
@SuppressWarnings({ "unchecked", "rawtypes" })
protected PMML4Result evaluate(final KiePMMLModel model, final PMMLContext context) {
if (logger.isDebugEnabled()) {
logger.debug("evaluate {} {}", model, context);
}
pmmlListeners.forEach(context::addPMMLListener);
addStep(() -> getStep(START, model, context.getRequestData()), context);
final ProcessingDTO processingDTO = preProcess(model, context);
addStep(() -> getStep(PRE_EVALUATION, model, context.getRequestData()), context);
PMMLModelEvaluator executor = getFromPMMLModelType(model.getPmmlMODEL()).orElseThrow(() -> new KiePMMLException(String.format("PMMLModelEvaluator not found for model %s", model.getPmmlMODEL())));
PMML4Result toReturn = executor.evaluate(knowledgeBase, model, context);
addStep(() -> getStep(POST_EVALUATION, model, context.getRequestData()), context);
postProcess(toReturn, model, context, processingDTO);
addStep(() -> getStep(END, model, context.getRequestData()), context);
return toReturn;
}
Aggregations