@Test public void getKiePMMLDroolsSampleAST() { final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = getFieldTypeMap(samplePmml.getDataDictionary(), samplePmml.getTransformationDictionary(), scorecardModel.getLocalTransformations()); List<KiePMMLDroolsType> types = Collections.emptyList(); KiePMMLDroolsAST retrieved = KiePMMLScorecardModelASTFactory.getKiePMMLDroolsAST(samplePmml.getDataDictionary(), scorecardModel, fieldTypeMap, types); assertNotNull(retrieved); assertEquals(types, retrieved.getTypes()); assertFalse(retrieved.getRules().isEmpty()); }
public static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLDroolsType> types) { logger.trace("getKiePMMLDroolsAST {} {} {}", dataDictionary, model, fieldTypeMap); DATA_TYPE targetType = getTargetFieldType(dataDictionary, model); final List<KiePMMLOutputField> outputFields = getOutputFields(model); KiePMMLScorecardModelCharacteristicASTFactory factory = KiePMMLScorecardModelCharacteristicASTFactory.factory(fieldTypeMap, outputFields, targetType); if (model.isUseReasonCodes()) { factory = factory.withReasonCodes(model.getBaselineScore(), REASONCODE_ALGORITHM.byName(model.getReasonCodeAlgorithm().value())); } final List<KiePMMLDroolsRule> rules = factory .declareRulesFromCharacteristics(model.getCharacteristics(), "", model.getInitialScore()); return new KiePMMLDroolsAST(types, rules); }
KiePMMLScorecardModelASTFactory extends KiePMMLAbstractModelASTFactory { public static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLDroolsType> types) { logger.trace("getKiePMMLDroolsAST {} {} {}", dataDictionary, model, fieldTypeMap); DATA_TYPE targetType = getTargetFieldType(dataDictionary, model); final List<KiePMMLOutputField> outputFields = getOutputFields(model); KiePMMLScorecardModelCharacteristicASTFactory factory = KiePMMLScorecardModelCharacteristicASTFactory.factory(fieldTypeMap, outputFields, targetType); if (model.isUseReasonCodes()) { factory = factory.withReasonCodes(model.getBaselineScore(), REASONCODE_ALGORITHM.byName(model.getReasonCodeAlgorithm().value())); } final List<KiePMMLDroolsRule> rules = factory .declareRulesFromCharacteristics(model.getCharacteristics(), "", model.getInitialScore()); return new KiePMMLDroolsAST(types, rules); } }
KiePMMLScorecardModelASTFactory extends KiePMMLAbstractModelASTFactory { public static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLDroolsType> types) { logger.trace("getKiePMMLDroolsAST {} {} {}", dataDictionary, model, fieldTypeMap); DATA_TYPE targetType = getTargetFieldType(dataDictionary, model); final List<KiePMMLOutputField> outputFields = getOutputFields(model); KiePMMLScorecardModelCharacteristicASTFactory factory = KiePMMLScorecardModelCharacteristicASTFactory.factory(fieldTypeMap, outputFields, targetType); if (model.isUseReasonCodes()) { factory = factory.withReasonCodes(model.getBaselineScore(), REASONCODE_ALGORITHM.byName(model.getReasonCodeAlgorithm().value())); } final List<KiePMMLDroolsRule> rules = factory .declareRulesFromCharacteristics(model.getCharacteristics(), "", model.getInitialScore()); return new KiePMMLDroolsAST(types, rules); } private  KiePMMLScorecardModelASTFactory(); }
KiePMMLScorecardModelASTFactory extends KiePMMLAbstractModelASTFactory { public static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLDroolsType> types) { logger.trace("getKiePMMLDroolsAST {} {} {}", dataDictionary, model, fieldTypeMap); DATA_TYPE targetType = getTargetFieldType(dataDictionary, model); final List<KiePMMLOutputField> outputFields = getOutputFields(model); KiePMMLScorecardModelCharacteristicASTFactory factory = KiePMMLScorecardModelCharacteristicASTFactory.factory(fieldTypeMap, outputFields, targetType); if (model.isUseReasonCodes()) { factory = factory.withReasonCodes(model.getBaselineScore(), REASONCODE_ALGORITHM.byName(model.getReasonCodeAlgorithm().value())); } final List<KiePMMLDroolsRule> rules = factory .declareRulesFromCharacteristics(model.getCharacteristics(), "", model.getInitialScore()); return new KiePMMLDroolsAST(types, rules); } private  KiePMMLScorecardModelASTFactory(); static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary,
                                                       final Scorecard model,
                                                       final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap,
                                                       final List<KiePMMLDroolsType> types); }
KiePMMLScorecardModelASTFactory extends KiePMMLAbstractModelASTFactory { public static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLDroolsType> types) { logger.trace("getKiePMMLDroolsAST {} {} {}", dataDictionary, model, fieldTypeMap); DATA_TYPE targetType = getTargetFieldType(dataDictionary, model); final List<KiePMMLOutputField> outputFields = getOutputFields(model); KiePMMLScorecardModelCharacteristicASTFactory factory = KiePMMLScorecardModelCharacteristicASTFactory.factory(fieldTypeMap, outputFields, targetType); if (model.isUseReasonCodes()) { factory = factory.withReasonCodes(model.getBaselineScore(), REASONCODE_ALGORITHM.byName(model.getReasonCodeAlgorithm().value())); } final List<KiePMMLDroolsRule> rules = factory .declareRulesFromCharacteristics(model.getCharacteristics(), "", model.getInitialScore()); return new KiePMMLDroolsAST(types, rules); } private  KiePMMLScorecardModelASTFactory(); static KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary,
                                                       final Scorecard model,
                                                       final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap,
                                                       final List<KiePMMLDroolsType> types);  }