Create a new revision with rules

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

Creates a new revision for the rule set with rules. In this request, you supply the content that you want to initialize for a new revision.

Request Samples

1

Response Samples

1{
2 "name": "Loan Score Approval",
3 "rules": [
4 {
5 "name": "Age Requirements",
6 "conditional": "if",
7 "ruleFiredTrackingEnabled": true,
8 "conditions": [
9 {
10 "type": "decisionTable",
11 "expression": "age > 10"
12 },
13 {
14 "type": "decisionTable",
15 "expression": "height > 123.00"
16 }
17 ],
18 "actions": [
19 {
20 "type": "assignment",
21 "expression": "approved = 'Y'"
22 }
23 ]
24 }
25 ],
26 "signature": [
27 {
28 "name": "age",
29 "dataType": "integer",
30 "direction": "input"
31 },
32 {
33 "name": "height",
34 "dataType": "decimal",
35 "direction": "input"
36 },
37 {
38 "name": "approved",
39 "dataType": "boolean",
40 "direction": "output"
41 }
42 ]
43}

Path Parameters

NameTypeRequiredDescription
ruleSetId
string
true

The rule set ID.

Query Parameters

NameTypeRequiredDescription
revisionType
string
false

Valid values are major or minor. This value determines how the server generates the major and minor numbers. If a major number is provided, the next available major version number is started. For example, if the rule set has revisions 1.0, 1.1, 1.2, 2.0, and 2.1, creating a new major revision results in 3.0. If a minor number is provided, then the next available minor revision number is reserved based on the existing revisions. For example, if the existing revisions have major and minor numbers of 1.1, 1.2, 1.3, 2.1, 2.2, and a user requests a new minor revision, then 2.3 is assigned. This parameter defaults to minor if not supplied.

Allowed values:
majorminor
fromRevisionUri
string</businessRules/ruleSets/{rulesetId}/revisions/{revisionId}>
false

This value specifies the URI of the rule set revision from which the new rule set revision is created. This property enables you to trace the lineage of a rule set. The valid format for this parameter is '/businessRules/ruleSets/${rulesetId}/revisions/${revisionId}'

Request Body

New content with which to create a rule set revision with rules.

The definition of a set of rules and the associated signature for them. This represents the application/vnd.sas.business.rule.set.integral media type (version 2).

Examples:
{"name":"Loan Score Approval","rules":[{"name":"Age Requirements","conditional":"if","ruleFiredTrackingEnabled":true,"conditions":[{"type":"decisionTable","expression":"age > 10"},{"type":"decisionTable","expression":"height > 123.00"}],"actions":[{"type":"assignment","expression":"approved = 'Y'"}]}],"signature":[{"name":"age","dataType":"integer","direction":"input"},{"name":"height","dataType":"decimal","direction":"input"},{"name":"approved","dataType":"boolean","direction":"output"}]}{"name":"Loan Score Approval","signature":[{"name":"customerName","dataType":"string","direction":"input"},{"name":"creditScore","dataType":"decimal","direction":"input"},{"name":"approved","dataType":"boolean","direction":"output"}]}
NameTypeRequiredDescription
id
string
false

The system-assigned unique ID for this object.

name
string
true

The name of the rule set.

ruleSetType
string<enumeration>
false

The type of rule set. Assignment rule sets enable users to specify variable assignment actions within business rules. Filtering rule sets contain business rules that are only conditions that must be matched for the data to be retained within the resulting output. Assignment is the default if not specified.

Allowed values:
assignmentfiltering
description
string
false

The rule set description

createdBy
string
false

The user who created the rule set.

creationTimeStamp
string<date-time>
false

The date and time that the rule set was created.

modifiedBy
string
false

The user ID of the authenticated user who last updated the rule set.

modifiedTimeStamp
string<date-time>
false

The date and time that the rule set was last modified.

majorRevision
integer
false

Major version number of the revision being viewed of the rule set. This value is assigned by the service, the user only has control on whether the major number or minor number is incremented when creating a new revision. This is a derived field that is generated on PUT/POST.

minorRevision
integer
false

Minor version number of the current revision of the rule set. This value is assigned by the service. The user only has control on whether the major number or minor number is incremented when creating a new revision. This is a derived field that is generated on PUT/POST.

checkout
boolean
false

Flag that indicates that the rule set is a user's working copy of another rule set.

locked
boolean
false

Flag that indicates if the content of the revision being viewed is locked or editable.

signature
array [Signature Term]
true

The set of terms local to this rule set with input and output behavior.

folderType
string
false

Indicates the type of folder where the rule set is housed.

sourceRevisionUri
string
false

The URI of the rule set revision this rule set is being created from.

copyTimeStamp
string<date-time>
false

The time stamp when the ruleset revision was copied.

testCustomContextUri
string
false

The URI of a Custom Context DS2 code file that provides a custom context to this rule set. The ruleset's custom context is usually provided by the decision that uses it. For syntax validation of rule expressions and for testing purposes, you can specify a testing-only custom context.

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 2.

rules
array [Rule]
true

The set of rules

Responses

StatusMeaningDescription
201CreatedA rule set revision was created.HeadersSchema
400Bad RequestThe request was invalid.Schema
404Not FoundNo resource exists at the requested path.Schema
428Precondition RequiredThe request headers did not include a `If-Unmodified-Since` precondition.Schema