Create a rule

post/ruleSets/{ruleSetId}/rules
Internal-Use Only

Creates a rule within the rule set.

Request Samples

1

Response Samples

1{
2 "name": "Age Requirements",
3 "conditional": "if",
4 "ruleFiredTrackingEnabled": true
5}

Path Parameters

NameTypeRequiredDescription
ruleSetId
string
true

The identifier of the rule set.

Query Parameters

NameTypeRequiredDescription
createVariables
boolean
false

If set to true, any variables that do not exist within the posted rule content are created if a valid data type can be derived from the expression or an optional data type is provided.

Request Body

Rules to add to a rule set.

The definition of a set of conditions and actions for use within a rule set. The defintion can also contain a rule that references a common rule, reference IDs and mappings. This represents application/vnd.sas.business.rule media type (version 4).

Example:
{"name":"Age Requirements","conditional":"if","ruleFiredTrackingEnabled":true}
NameTypeRequiredDescription
id
string
false

The system-assigned unique ID for this object

name
string
true

The name of the rule. Rule names must be unique within a rule set.

description
string
false

The rule description

createdBy
string
false

The user who created the rule.

creationTimeStamp
string<date-time>
false

The date and time that the rule was created.

modifiedBy
string
false

The userId of the authenticated user who last updated the rule.

modifiedTimeStamp
string<date-time>
false

The date and time that the rule was last modified.

conditional
string<enumeration>
true

Determines how the rule is related to this preceding rule. By default all rules are considered 'if' based which means that there logic is executed regardless of the how other rules within the rule set evaluate. However if a user chooses to use 'elseif' or 'or' the rule is only evaluated if the previous rule evaluates to 'false'. In the case of 'or' all actions are determined by the previous if/elseif in the set with actions. If a rule is a reference to a common rule, its conditional is set to 'ref'.

Allowed values:
ifelseiforref
ruleFiredTrackingEnabled
boolean
true

Set to true if you want during executions of this rule for rule fired tracking information to be recorded. False if this rule should not have tracking turned on.

status
string<enumeration>
false

The validation status of the rule. This is set to valid if no conditions or actions have validation errors. Its set to false if there are any validation errors across all its conditions and actions.

Allowed values:
validerror
conditions
array [Rule Condition]
false

The list of conditions which all need to be met to execute the rules actions.

actions
array [Rule Action]
false

The list of actions which should be executed if the rule's conditions are all satisfied. This is not applicable for 'filtering' type rule sets as all actions are considered to be removing the current row from the output if it does not match the provided conditions.

commonRuleSetId
string
false

The unique id of the common ruleset that this rules references

commonRuleSetVersionId
string
false

The unique id of the revision of the common ruleset tat this rule references

ruleMappings
array [Reference Rule Mapping]
false

The list of mappings to be used when code is generated to subsitute terms from the rule set to terms from a referenced rule set.

links
array [Link]
false

Zero or more links to related resources or operations.

version
integer
false

This media type's schema version number. This representation is version 3.

Responses

StatusMeaningDescription
201CreatedThe rule was created.HeadersSchema
400Bad RequestThe request was invalid.Schema