class 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();

}