class KiePMMLScorecardModelCharacteristicASTFactory {

    public List<KiePMMLDroolsRule> declareRulesFromCharacteristics(final Characteristics characteristics, final String parentPath, Number initialScore) {
        logger.trace("declareRulesFromCharacteristics {} {} {}", characteristics, parentPath, initialScore);
        final List<KiePMMLDroolsRule> toReturn = new ArrayList<>();
        final List<Characteristic> characteristicList = characteristics.getCharacteristics();
        for (int i = 0; i < characteristicList.size(); i++) {
            final Characteristic characteristic = characteristicList.get(i);
            if (i == 0) {
                String statusConstraint = StringUtils.isEmpty(parentPath) ? KiePMMLAbstractModelASTFactory.STATUS_NULL : String.format(KiePMMLAbstractModelASTFactory.STATUS_PATTERN, parentPath);
                String currentRule = String.format(PATH_PATTERN, parentPath, characteristic.getName());
                KiePMMLDroolsRule.Builder builder = KiePMMLDroolsRule.builder(currentRule, currentRule, null)
                        .withStatusConstraint(statusConstraint);
                if (initialScore != null) {
                    builder = builder.withAccumulation(initialScore);
                }
                toReturn.add(builder.build());
            }
            boolean isLastCharacteristic = (i == characteristicList.size() - 1);
            String statusToSet = isLastCharacteristic ? DONE : String.format(PATH_PATTERN, parentPath, characteristicList.get(i + 1).getName());
            declareRuleFromCharacteristic(characteristic, parentPath, toReturn, statusToSet, isLastCharacteristic);
        }
        return toReturn;
    }

    private  KiePMMLScorecardModelCharacteristicASTFactory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLOutputField> outputFields, final DATA_TYPE targetType);

}