create_business_rule
Add a new rule to an existing SAS Business Rules rule set by specifying conditions, actions, and conditional type. Define expressions with variable names and enable rule firing tracking as needed.
Instructions
Create a new rule inside an existing SAS Business Rules rule set.
A rule set can hold multiple rules, each evaluated per its conditional
type. Condition/action expressions must include the variable name
directly (e.g. "credit_score < 650", not just "< 650") — the
API accepts the latter as valid but generates DS2 code with a missing
left-hand operand. Boolean signature variables must be compared with
= 0/= 1 in expressions, not = false/= true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name (max 30 chars). | |
| actions | Yes | List of actions, each ``{"type": "assignment"|"return", "term": {"name", "dataType", "direction"}, "expression"}``. | |
| conditions | Yes | List of conditions (multiple conditions AND together), each ``{"type": "complex", "expression", "term": {"name", "dataType", "direction"}}``. | |
| ruleset_id | Yes | The rule set UUID to add the rule to (not its name — list_business_rulesets returns both). | |
| conditional | Yes | "if" starts a new independent rule chain, "elseif" continues the previous rule's chain, "or" ORs into it. | |
| rule_fired_tracking_enabled | Yes | Whether to record when this rule fires. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||