use of org.kie.pmml.commons.model.expressions.KiePMMLExpression in project drools by kiegroup.
the class KiePMMLOutputFieldInstanceFactory method getKiePMMLOutputField.
public static KiePMMLOutputField getKiePMMLOutputField(final OutputField outputField) {
String name = outputField.getName() != null ? outputField.getName().getValue() : "" + outputField.hashCode();
final String targetField = outputField.getTargetField() != null ? outputField.getTargetField().getValue() : null;
final RESULT_FEATURE resultFeature = outputField.getResultFeature() != null ? RESULT_FEATURE.byName(outputField.getResultFeature().value()) : null;
final DATA_TYPE dataType = outputField.getDataType() != null ? DATA_TYPE.byName(outputField.getDataType().value()) : null;
final KiePMMLExpression kiePMMLExpression = outputField.getExpression() != null ? getKiePMMLExpression(outputField.getExpression()) : null;
final KiePMMLOutputField.Builder builder = KiePMMLOutputField.builder(name, Collections.emptyList()).withResultFeature(resultFeature).withTargetField(targetField).withValue(outputField.getValue()).withDataType(dataType).withRank(outputField.getRank()).withKiePMMLExpression(kiePMMLExpression);
return builder.build();
}
use of org.kie.pmml.commons.model.expressions.KiePMMLExpression in project drools by kiegroup.
the class KiePMMLExpressionInstanceFactoryTest method getKiePMMLExpression.
@Test
public void getKiePMMLExpression() {
Expression toConvert = getRandomApply();
KiePMMLExpression retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomConstant();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomDiscretize();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomFieldRef();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomMapValues();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomNormContinuous();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomNormDiscrete();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
toConvert = getRandomTextIndex();
retrieved = KiePMMLExpressionInstanceFactory.getKiePMMLExpression(toConvert);
commonVerifyKiePMMLExpression(retrieved, toConvert);
}
Aggregations