Search in sources :

Example 6 with False

use of org.dmg.pmml.False in project drools by kiegroup.

the class KiePMMLScorecardModelCharacteristicASTFactory method declareRuleFromAttribute.

protected void declareRuleFromAttribute(final Attribute attribute, final String parentPath, final int attributeIndex, final List<KiePMMLDroolsRule> rules, final String statusToSet, final String characteristicReasonCode, final Number characteristicBaselineScore, final boolean isLastCharacteristic) {
    logger.trace("declareRuleFromAttribute {} {}", attribute, parentPath);
    final Predicate predicate = attribute.getPredicate();
    // an XOR compound predicate
    if (predicate instanceof False) {
        return;
    }
    String currentRule = String.format(PATH_PATTERN, parentPath, attributeIndex);
    KiePMMLReasonCodeAndValue reasonCodeAndValue = getKiePMMLReasonCodeAndValue(attribute, characteristicReasonCode, characteristicBaselineScore);
    PredicateASTFactoryData predicateASTFactoryData = new PredicateASTFactoryData(predicate, outputFields, rules, parentPath, currentRule, fieldTypeMap);
    KiePMMLPredicateASTFactory.factory(predicateASTFactoryData).declareRuleFromPredicate(attribute.getPartialScore(), statusToSet, reasonCodeAndValue, isLastCharacteristic);
}
Also used : KiePMMLReasonCodeAndValue(org.kie.pmml.models.drools.tuples.KiePMMLReasonCodeAndValue) False(org.dmg.pmml.False) PredicateASTFactoryData(org.kie.pmml.models.drools.ast.factories.PredicateASTFactoryData) Predicate(org.dmg.pmml.Predicate)

Aggregations

False (org.dmg.pmml.False)6 Predicate (org.dmg.pmml.Predicate)3 Test (org.junit.Test)3 PredicateASTFactoryData (org.kie.pmml.models.drools.ast.factories.PredicateASTFactoryData)3 BlockStmt (com.github.javaparser.ast.stmt.BlockStmt)1 Statement (com.github.javaparser.ast.stmt.Statement)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 IntStream (java.util.stream.IntStream)1 CompoundPredicate (org.dmg.pmml.CompoundPredicate)1 DataField (org.dmg.pmml.DataField)1 Field (org.dmg.pmml.Field)1 SimplePredicate (org.dmg.pmml.SimplePredicate)1 SimpleSetPredicate (org.dmg.pmml.SimpleSetPredicate)1 True (org.dmg.pmml.True)1 KiePMMLFalsePredicate (org.kie.pmml.commons.model.predicates.KiePMMLFalsePredicate)1 KiePMMLPredicate (org.kie.pmml.commons.model.predicates.KiePMMLPredicate)1 PMMLModelTestUtils.getRandomCompoundPredicate (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomCompoundPredicate)1 PMMLModelTestUtils.getRandomDataField (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomDataField)1 PMMLModelTestUtils.getRandomSimplePredicate (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomSimplePredicate)1