// Do PreProcessing on Parameters
if(this.preProcessor != null && !this.preProcessor.isEmpty())
processor.doScriptProcessing(this.preProcessor, parameters);
for(FieldName activeField : activeFields){
DataField dataField = this.evaluator.getDataField(activeField);
Object value = parameters.get(dataField.getName().getValue());
if(value == null || value.toString().isEmpty()) {
result.addError("No parameter found for: " + dataField.getName());
log.log(Level.WARNING, "No parameter found for: " + dataField.getName());
} else {
try {
arguments.put(activeField, evaluator.prepare(activeField, value));
} catch (Exception e) {
result.addError("Field " + activeField.getValue() + " has invalid value " + value);
log.log(Level.SEVERE, e.getMessage());
result.setValid(false);
return result;
}
}
}
try {
pmmlResult = evaluator.evaluate(arguments);
} catch (Exception e) {
result.addError("Unable to evaluate model: " + e.getMessage());
log.log(Level.WARNING, "Unable to evaluate model: " + e.getMessage());
return result;
}
List<FieldName> predictedFields = evaluator.getPredictedFields();
for(FieldName predictedField : predictedFields){
DataField dataField = evaluator.getDataField(predictedField);
Object predictedValue = pmmlResult.get(predictedField);
result.addPredictedValue(dataField.getName().getValue(), predictedValue);
}
List<FieldName> resultFields = this.evaluator.getOutputFields();
for(FieldName resultField : resultFields){
OutputField outputField = evaluator.getOutputField(resultField);