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)

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

Notes

User must have RULE_MODIFY and RULE_VIEW permissions. User must have rule LOCKED. To modify something in DECISION TABLE body, pass entire rule body (all conditions/actions/data), regardless of whether they were updated or not (eg, this is a total replacement of rule body). 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.

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on 16 May 2017, at 01:20.