Search in sources :

Example 1 with KiePMMLExtension

use of org.kie.pmml.commons.model.KiePMMLExtension in project drools by kiegroup.

the class KiePMMLSimplePredicateInstanceFactory method getKiePMMLSimplePredicate.

static KiePMMLSimplePredicate getKiePMMLSimplePredicate(final SimplePredicate simplePredicate, final List<Field<?>> fields) {
    final List<KiePMMLExtension> kiePMMLExtensions = getKiePMMLExtensions(simplePredicate.getExtensions());
    DataType dataType = getDataType(fields, simplePredicate.getField().getValue());
    Object value = DATA_TYPE.byName(dataType.value()).getActualValue(simplePredicate.getValue());
    return KiePMMLSimplePredicate.builder(simplePredicate.getField().getValue(), kiePMMLExtensions, OPERATOR.byName(simplePredicate.getOperator().value())).withValue(value).build();
}
Also used : DataType(org.dmg.pmml.DataType) ModelUtils.getDataType(org.kie.pmml.compiler.api.utils.ModelUtils.getDataType) KiePMMLExtension(org.kie.pmml.commons.model.KiePMMLExtension)

Aggregations

DataType (org.dmg.pmml.DataType)1 KiePMMLExtension (org.kie.pmml.commons.model.KiePMMLExtension)1 ModelUtils.getDataType (org.kie.pmml.compiler.api.utils.ModelUtils.getDataType)1