Update a Batch Rule

Updates a batch rule.

With this service method, you can modify the attribute values of a batch rule specified by its ID and rule project ID. The modified values are provided via the request payload, which contains the modified values along with all the values that shall remain unchanged.

Request

URI: /v1/projects/<projectId>/batch-rules/<ID>

HTTP Method: PUT

Permissions: <rule>.u

Request Headers

Header Required Values
If-match Yes Check if cached version matches current server version of the batch rule.

Request Parameters

Parameter Required Data Type Description Parameter Type
projectId Yes string Unique ID of the rule project to which the rule is assigned. Path
ID Yes string Unique ID of the rule to be modified. Path

Request Example

/v1/projects/185d9a72-a629-4b94-b421-a2f0301bb072/batch-rules/79ded171-8926-4dff-bf73-fc2d3070a100

With this request, you update the rule with ID "79ded171..." that is contained in rule project "185d9a72...".

Response

Response Status and Error Codes

Code Description
200 Rule updated successfully.
401 Unauthorized. Rule couldn't be updated due to insufficient access rights.
403 Forbidden.
404 Not found. For example, an invalid rule ID or project ID has been provided.

Response Example

{
    "name": "MyBatchRuleName",
    "timeFrame": "PT1H",
    "scheduling": {
        "startTime": "2019-03-18T13:26:58.756",
        "endTime": "2019-03-20T13:26:58.756",
        "recurrence": "Daily",
        "value": "*/5 * * * * *"
    },
    "toggle": false,
    "texts": [
        {
            "language": "en",
            "shortText": "Short text for my rule",
            "description": "Long description for my rule"
        },
        {
            "language": "de",
            "shortText": "Kurztext für die Regel",
            "description": "Lange Beschreibung für die erstellte Regel"
        }
    ],
    "tags": [
        {
            "tag": "MyRule"
        }
    ],
    "inputDataObjectNames": [
        {
            "name": "timeSeriesDOName_aggregate"
        }
    ],
    "brRuleData": {
        "Branches": [
            {
                "Id": "f44194e3a0714e1cb90f6bb7ae194f18",
                "SequenceNumber": 1,
                "Condition": {
                    "Expression": "",
                    "AST": [
                        {
                            "Id": "2e0319e60e9b497d80a85e34f06cc047",
                            "Root": false,
                            "Value": "100",
                            "Parentheses": false,
                            "Children": [],
                            "Output": {
                                "DataObjectType": "E",
                                "BusinessDataType": "N"
                            }
                        },
                        {
                            "Id": "969dafe70373439fbb93022a011577e4",
                            "Root": true,
                            "Value": null,
                            "Function": "IsGreater",
                            "Parentheses": false,
                            "Children": [
                                {
                                    "Id": "663da75ee4484d7d99e76589683283d4",
                                    "SequenceNumber": 1
                                },
                                {
                                    "Id": "2e0319e60e9b497d80a85e34f06cc047",
                                    "SequenceNumber": 2
                                }
                            ],
                            "Output": {
                                "DataObjectType": null,
                                "BusinessDataType": null
                            }
                        },
                        {
                            "Id": "663da75ee4484d7d99e76589683283d4",
                            "Root": false,
                            "Value": null,
                            "Reference": "/77d422e394f74dd5a4134a94cbae6b52/caa36402ea414ab98faa831b2ea47508",
                            "Parentheses": false,
                            "Children": [],
                            "Output": null
                        }
                    ]
                },
                "Operation": [
                    {
                        "Id": "b044d0873e5b4568888a6de2970ecbce",
                        "SequenceNumber": 3,
                        "Segment": "77c813a220384e52abcb7cb2a28cc06f",
                        "Expression": null,
                        "AST": [
                            {
                                "Id": "EEE4B2AF97474F349D31E4A6A611ECB2",
                                "Root": true,
                                "Value": "high",
                                "Parentheses": false,
                                "Children": [],
                                "Output": {
                                    "DataObjectType": "E",
                                    "BusinessDataType": "S"
                                }
                            }
                        ]
                    },
                    {
                        "Id": "7770379f26274734a1618360bafceb43",
                        "SequenceNumber": 2,
                        "Segment": "85a70a28841044bba3d75091f168b4ed",
                        "Expression": null,
                        "AST": [
                            {
                                "Id": "375FD781637C4E10A2790D065568EEA7",
                                "Root": true,
                                "Value": "NewEvent",
                                "Parentheses": false,
                                "Children": [],
                                "Output": {
                                    "DataObjectType": "E",
                                    "BusinessDataType": "S"
                                }
                            }
                        ]
                    }
                ]
            }
        ],
        "Default": {
            "Id": "544f71f2d399455fa1d1a9d84949cc0f",
            "Operation": [
                {
                    "Id": "0b717244129c4970818c7abd211d1f74",
                    "SequenceNumber": 4,
                    "Segment": "39c694c2044047f496459abb16a6a0ce",
                    "Expression": null,
                    "AST": [
                        {
                            "Id": "94B18535FF2748DD984048C5426F84A4",
                            "Root": true,
                            "Value": "",
                            "Parentheses": false,
                            "Children": [],
                            "Output": {
                                "DataObjectType": "E",
                                "BusinessDataType": "S"
                            }
                        }
                    ]
                }
            ]
        }
    }
}