Error With MWS PUT API: "com.webmethods.caf.rules.osgi.services.impl.MergingException: Adding new rules is not allowed yet."

Hi

I am using webMethods 10.5 and looking to use the MWS APIs to update the decision tables. I can Lock, Unlock, Deploy, but when I try create a new row or delete a row, I get the following response back:

{
    "error_description": "com.webmethods.caf.rules.osgi.services.impl.MergingException: Adding new rules is not allowed yet."
}

Are there other APIs that I can use to add/delete rows in decision tables?

HI Marco,

please provide more detailed informations about your issue as the provided information is not sufficient to offer you any further guidance.

Regards,
Holger

Hi Holger

I am calling the Save service to add 1 additional rule row. In the example below, I only had 2 objects in the “rules” array (ruleId 0 and 1). Now I am try to use the PUT API below to add 1 new object (ruleId 2). When I run the API, it returns the error in my post above. Previously I was using the webMethods browser MWS, but am exploring the use of the APIs instead to edit my rulesets.

curl --location --request PUT '{{MWS_ENDPOINT}}/wm_rma/rest/content/project/{{PROJECT_NAME}}/decisiontable/{{DECISION_TABLE_NAME}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{AUTHORIZATION}}' \
--data '{
    "name": "{{DECISION_TABLE_NAME}}",
    "ruleProjectName": "{{PROJECT_NAME}}",
    "processingModeType": "SEQUENTIAL_PROCESSING_FIRST_FIRED",
    "parameters": [
        {
            "name": "{{RULESET_NAME}}",
            "parameterType": "BOTH",
            "parameterId": "7785616f:16a20e18b65:-7875",
            "parameterElements": [
                {
                    "parameterElementId": "19886975-27be-47a1-a1d8-ae233371f38f",
                    "name": "code",
                    "parameterId": "7785616f:16a20e18b65:-7875"
                },
                {
                    "parameterElementId": "f3f188d5-99af-4142-9b87-4b96a424bf6d",
                    "name": "score",
                    "parameterId": "7785616f:16a20e18b65:-7875"
                }
            ],
            "dataModel": {
                "id": "7785616f:16a20e18b65:-7875",
                "name": "{{RULESET_NAME}}",
                "dataModelPath": "/{{PROJECT_NAME}}/Data Models/{{DATA_MODEL_NAME}}.datamodel"
            }
        }
    ],
    "actions": [],
    "columns": [
        {
            "id": "19886975-27be-47a1-a1d8-ae233371f38f",
            "name": "code",
            "columnType": "CONDITION",
            "parameterId": "7785616f:16a20e18b65:-7875",
            "actionId": 0,
            "isPrincipalType": false
        },
		{
            "id": "ec81dc52-9f70-400a-a02d-40ee32681383",
            "name": "score",
            "columnType": "RESULT",
            "parameterId": "7785616f:16a20e18b65:-7875",
            "actionId": 0,
            "isPrincipalType": false
        }
    ],
    "rules": [
        {
            "ruleId": 0,
            "conditions": [
                {
                    "columnId": "19886975-27be-47a1-a1d8-ae233371f38f",
                    "conditionOperatorType": "EQ",
                    "value": {
                        "type": "literal",
                        "literal": "CODE1"
                    }
                }
            ],
            "results": [
                {
                    "columnId": "ec81dc52-9f70-400a-a02d-40ee32681383",
                    "assignmentOperatorType": "AS",
                    "value": {
                        "type": "literal",
                        "literal": "100"
                    }
                }
            ]
        },
        {
            "ruleId": 1,
            "conditions": [
                {
                    "columnId": "19886975-27be-47a1-a1d8-ae233371f38f",
                    "conditionOperatorType": "EQ",
                    "value": {
                        "type": "literal",
                        "literal": "CODE2"
                    }
                }
            ],
            "results": [
                {
                    "columnId": "ec81dc52-9f70-400a-a02d-40ee32681383",
                    "assignmentOperatorType": "AS",
                    "value": {
                        "type": "literal",
                        "literal": "200"
                    }
                }
            ]
        },
        {
            "ruleId": 2,
            "conditions": [
                {
                    "columnId": "19886975-27be-47a1-a1d8-ae233371f38f",
                    "conditionOperatorType": "EQ",
                    "value": {
                        "type": "literal",
                        "literal": "CODE3"
                    }
                }
            ],
            "results": [
                {
                    "columnId": "ec81dc52-9f70-400a-a02d-40ee32681383",
                    "assignmentOperatorType": "AS",
                    "value": {
                        "type": "literal",
                        "literal": "300"
                    }
                }
            ]
        }
    ]
}'

I presume you are already following this document.

Can you provide your environment’s fix level and related __full__.log entries as well ?

1 Like