use of org.kie.pmml.evaluator.core.implementations.PMMLRuntimeStep in project drools by kiegroup.
the class PMMLRuntimeInternalImplTest method evaluateWithPmmlRuntimeListeners.
@Test
public void evaluateWithPmmlRuntimeListeners() {
final PMMLRequestData requestData = getPMMLRequestData();
final List<PMMLStep> pmmlSteps = new ArrayList<>();
final PMMLContext pmmlContext = new PMMLContextImpl(requestData);
pmmlRuntime.addPMMLListener(getPMMLListener(pmmlSteps));
pmmlRuntime.evaluate(modelMock, pmmlContext);
Arrays.stream(PMML_STEP.values()).forEach(pmml_step -> {
Optional<PMMLStep> retrieved = pmmlSteps.stream().filter(pmmlStep -> pmml_step.equals(((PMMLRuntimeStep) pmmlStep).getPmmlStep())).findFirst();
assertTrue(retrieved.isPresent());
commonValuateStep(retrieved.get(), pmml_step, modelMock, requestData);
});
}
use of org.kie.pmml.evaluator.core.implementations.PMMLRuntimeStep in project drools by kiegroup.
the class PMMLRuntimeInternalImpl method getStep.
PMMLStep getStep(final PMML_STEP pmmlStep, final KiePMMLModel model, final PMMLRequestData requestData) {
final PMMLStep toReturn = new PMMLRuntimeStep(pmmlStep);
toReturn.addInfo("MODEL", model.getName());
toReturn.addInfo("CORRELATION ID", requestData.getCorrelationId());
toReturn.addInfo("REQUEST MODEL", requestData.getModelName());
requestData.getRequestParams().forEach(requestParam -> toReturn.addInfo(requestParam.getName(), requestParam.getValue()));
return toReturn;
}
use of org.kie.pmml.evaluator.core.implementations.PMMLRuntimeStep in project drools by kiegroup.
the class PMMLRuntimeInternalImplTest method evaluateWithPMMLContextListeners.
@Test
public void evaluateWithPMMLContextListeners() {
final PMMLRequestData requestData = getPMMLRequestData();
final List<PMMLStep> pmmlSteps = new ArrayList<>();
final PMMLContext pmmlContext = new PMMLContextImpl(requestData, Collections.singleton(getPMMLListener(pmmlSteps)));
pmmlRuntime.evaluate(modelMock, pmmlContext);
Arrays.stream(PMML_STEP.values()).forEach(pmml_step -> {
Optional<PMMLStep> retrieved = pmmlSteps.stream().filter(pmmlStep -> pmml_step.equals(((PMMLRuntimeStep) pmmlStep).getPmmlStep())).findFirst();
assertTrue(retrieved.isPresent());
commonValuateStep(retrieved.get(), pmml_step, modelMock, requestData);
});
}
Aggregations