Updates a business ruleset. Passing rules replaces the entire membership of the ruleset. To change membership incrementally, use Add business rules to a ruleset or Remove business rules from a ruleset instead.
Use this operation to rename a ruleset, to change the strategy in execute_mode, or to set the membership and priorities of the ruleset in one call.
Prerequisites & Constraints
Each rule referenced in rules must already exist.
Impacts
Business ruleset
The attributes you pass are updated, and updated_at and updated_by are set. When rules is passed, the membership of the ruleset becomes exactly the rules listed: rules that are not in the list are removed from the ruleset, and the priorities of the remaining rules are set from the list.
A rule dropped from the membership this way is not deleted. It remains available to other rulesets and can still be applied on its own.
Implementation Notes
Read the current membership with List rules in a business ruleset before passing rules, so that you do not drop a rule you meant to keep.
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
Strategy that determines how the rules in the ruleset are evaluated and when evaluation stops.
Evaluation stops as soon as a rule evaluates to true. The rules that come later in the evaluation order are not evaluated.
Evaluation stops as soon as a rule evaluates to false. The rules that come later in the evaluation order are not evaluated.
Every rule in the ruleset is evaluated and all the results are returned. This is the default.
Every rule in the ruleset is evaluated, and only the rules that evaluated to true are returned.
The business rules that make up the ruleset, along with the priorities that determine their positions in its evaluation order. Each entry takes the rule_id of an existing business rule and an optional priority; when priority is omitted, it is assigned from the position of the entry in the array. Pass the list as a JSON array.
Constraints
- Passing this parameter replaces the entire membership of the ruleset. To change the membership incrementally, use Add business rules to a ruleset or Remove business rules from a ruleset instead.
- Each
rule_idmust belong to a business rule that already exists, and can appear only once in the list. - A
prioritycan be used by only one rule in the ruleset. Two entries that carry the samepriorityare rejected.
Example →
rules = [{"rule_id":"custom-uuid-1","priority":1},{"rule_id":"custom-uuid-2","priority":2}]
Returns
The updated business ruleset. When rules was passed, its membership is exactly the rules listed and the priorities of those rules are set from the list.