Jump to: navigation, search

Modify DECISION TABLE Rule Body

Method

PUT

Syntax

 
/grs/v1/tenant/{tenantId}/package/{packageId}/decisiontablebody/{ruleId}<br/>

Optional parameter:

  • ?checkInComment=My change (check in comment appears in audit tab and package history tab for the rule)

Notes

  • Warning—To modify something in the Decision Table body, pass the entire rule body (all conditions/actions/data), regardless of what you updated (this is a total replacement of rule body). So even if you are only changing 1 row of 100, you must effectively replace the contents of all of the data. There is a risk of data loss if you do not submit the entire rule body. There is currently no API for deletion of a single Decision Table row. If the change causes the rule to not validate, a 422 will be returned with a list of "compiler errors". The changes have still been committed.
  • User must have RULE_MODIFY and RULE_VIEW permissions.
  • User must have the rule LOCKED.

Request Body

To modify condition/action columns and row data, pass in "conditions", "actions" and "data" elements. If "conditions" or "actions" are not passed, then no changes will be made. "data" must always be passed. If only "data" is changing (values changed, new rows inserted, other rows deleted, etc), just pass in the changed "data" structure (see below).

 
"conditions": [
{
"header": "Debt is less than",
"sentence": "Debt is less than {debt}",
"factType": "Debt is less than {debt}",
"factField": null,
"constraintValueType": 5,
"segmentList": ["\"{debt}\""]
},
{
"header": "Age is between",
"sentence": "Age is between {age_low} and {age_high}",
"factType": "Age is between {age_low} and {age_high}",
"factField": null,
"constraintValueType": 5,
"segmentList": [
"\"{age_low}\"",
" and ",
"\"{age_high}\""
]
}
],
"actions": [
{
"header": "Decision is",
"sentence": "Decision is \"{decision}\"",
"segmentList": ["\"{decision}\""]
},
{
"header": "Stop processing",
"sentence": "Stop processing",
"segmentList": ["Stop processing"]
}
],
"data": [ [
null,
"DTR-209",
"",
"33333",
"22",
"and",
"23",
"OK",
"Stop processing"
]]
}
 
Data changed only
{
"data": [ [
null,
"DTR-209",
"",
"44444",
"33",
"and",
"44",
"OK",
"Stop processing"
]]
}

Response Body

 
{
"ruleId": "2e11aaa7-12c4-4cf2-8a74-4dbfcf8ed76e",
"ruleType": "DECISION_TABLE",
"extRuleId": "DT-208",
"name": "test dt 2",
"description": "",
"phase": "1st",
"calendarId":"Calendar_117",
"nodeId": "pkg",
"salience": 100000,
"bcLevel": 1,
"locked": false,
"lockOwner": null,
"dateEffective": null,
"dateExpired": null,
"pendingSnapshot": true,
"conditions": [
{
"header": "Debt is less than",
"sentence": "Debt is less than {debt}",
"factType": "Debt is less than {debt}",
"factField": null,
"constraintValueType": 5,
"segmentList": ["\"{debt}\""]
},
{
"header": "Age is between",
"sentence": "Age is between {age_low} and {age_high}",
"factType": "Age is between {age_low} and {age_high}",
"factField": null,
"constraintValueType": 5,
"segmentList": [
"\"{age_low}\"",
" and ",
"\"{age_high}\""
]
}
],
"actions": [
{
"header": "Decision is",
"sentence": "Decision is \"{decision}\"",
"segmentList": ["\"{decision}\""]
},
{
"header": "Stop processing",
"sentence": "Stop processing",
"segmentList": ["Stop processing"]
}
],
"data": [ [
null,
"DTR-209",
"",
"33333",
"22",
"and",
"23",
"OK",
"Stop processing"
]]
}

HTTP Status Codes

  • 200 Successful—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant ID or package ID, or does not have proper permission to perform this operation.
  • 404 Not Found—could not find specified rule ID.
  • 412 Precondition Failed—Rule was not locked first
  • 422 Unprocessable Entity—Rule does not validate
 
{
"message": "Validation Failed",
  "errors": [
    {
      "message": "Validation error 1"
    },
    {
      "message": "Validation error 2"
    }
  ]
}
  • 503—Service Unavailable
This page was last edited on June 27, 2018, at 08:16.
Comments or questions about this documentation? Contact us for support!