    protected void addParameters(final Map<String, String> values) {
        LOG.info("Adding parameters");
        Entity params = parameterService.getParameter();
        Entity currency = dataDefinitionService
                .get(SamplesConstants.BASIC_PLUGIN_IDENTIFIER, SamplesConstants.BASIC_MODEL_CURRENCY).find()
                .add(SearchRestrictions.eq("alphabeticCode", values.get("code"))).uniqueResult();
        params.setField("currency", currency);
        params.setField("unit", values.get("unit"));
        params.setField("company", getCompany(values.get(OWNER)));
        if (isEnabledOrEnabling("productionCounting")) {
            params.setField("registerQuantityInProduct", true);
            params.setField("registerQuantityOutProduct", true);
            params.setField("registerProductionTime", true);
            params.setField("justOne", false);
            params.setField("allowToClose", false);
            params.setField("autoCloseOrder", false);
        }
        if (isEnabledOrEnabling("qualityControls")) {
            params.setField("checkDoneOrderForQuality", false);
            params.setField("autoGenerateQualityControl", false);
        }
        if (isEnabledOrEnabling("genealogies")) {
            params.setField("batchForDoneOrder", "01none");
        }
        if (isEnabledOrEnabling("advancedGenealogy")) {
            params.setField("batchNumberUniqueness", "01globally");
        }
        if (isEnabledOrEnabling("advancedGenealogyForOrders")) {
            params.setField("trackingRecordForOrderTreatment", "01duringProduction");
            params.setField("batchNumberRequiredInputProducts", false);
        }
        if (isEnabledOrEnabling("materialRequirements")) {
            params.setField("inputProductsRequiredForType", "01startOrder");
        }
        if (isEnabledOrEnabling("materialFlowResources")) {
            params.setField("changeDateWhenTransferToWarehouseType", "01never");
        }
        params.getDataDefinition().save(params);
    }

    protected void addParameters(final Map<String, String> values) {
        LOG.info("Adding parameters");
        Entity params = parameterService.getParameter();
        Entity currency = dataDefinitionService
                .get(SamplesConstants.BASIC_PLUGIN_IDENTIFIER, SamplesConstants.BASIC_MODEL_CURRENCY).find()
                .add(SearchRestrictions.eq("alphabeticCode", values.get("code"))).uniqueResult();
        params.setField("currency", currency);
        params.setField("unit", values.get("unit"));
        params.setField("company", getCompany(values.get(OWNER)));
        if (isEnabledOrEnabling("productionCounting")) {
            params.setField("typeOfProductionRecording", "02cumulated");
            params.setField("registerQuantityInProduct", true);
            params.setField("registerQuantityOutProduct", true);
            params.setField("registerProductionTime", true);
            params.setField("justOne", false);
            params.setField("allowToClose", false);
            params.setField("autoCloseOrder", false);
        }
        if (isEnabledOrEnabling("qualityControls")) {
            params.setField("checkDoneOrderForQuality", false);
            params.setField("autoGenerateQualityControl", false);
        }
        if (isEnabledOrEnabling("genealogies")) {
            params.setField("batchForDoneOrder", "01none");
        }
        if (isEnabledOrEnabling("advancedGenealogy")) {
            params.setField("batchNumberUniqueness", "01globally");
        }
        if (isEnabledOrEnabling("advancedGenealogyForOrders")) {
            params.setField("trackingRecordForOrderTreatment", "01duringProduction");
            params.setField("batchNumberRequiredInputProducts", false);
        }
        if (isEnabledOrEnabling("materialRequirements")) {
            params.setField("inputProductsRequiredForType", "01startOrder");
        }
        if (isEnabledOrEnabling("materialFlowResources")) {
            params.setField("changeDateWhenTransferToWarehouseType", "01never");
        }
        params.getDataDefinition().save(params);
    }
