Evaluate Decision
Evaluates a given decision and returns the result. The input values of the decision have to be supplied in the request body.
Method
POST /decision-definition/{id}/evaluate
POST /decision-definition/key/{key}/evaluate
(evaluates the latest version of the decision definition which belongs to no tenant)
POST /decision-definition/key/{key}/tenant-id/{tenant-id}/evaluate
(evaluates the latest version of the decision definition for tenant)
Parameters
Path Parameters
Name | Description |
---|---|
id | The id of the decision definition to be evaluated. |
key | The key of the decision definition (the latest version thereof) to be retrieved. |
tenant-id | The id of the tenant the decision definition belongs to. |
Request Body
A JSON object with the following properties:
Name | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
variables | A JSON object containing the variables the decision is to be evaluated with. Each key corresponds to a variable name and each value to a variable value. A variable value is a JSON object with the following properties:
|
Result
A JSON array representing the result of the newly evaluated decision. The array contains the output values as key-value pairs. Each key is an output name and each value an output value object that has the following properties:
Name | Value | Description |
---|---|---|
value | String / Number / Boolean / Object | The variable's value. |
type | String | The value type of the variable. |
valueInfo | Object |
A JSON object containing additional, value-type-dependent properties.
For variables of type
|
See the user guide for details about the decision result.
Response codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
403 | application/json | The authenticated user is unauthorized to evaluate this decision. See the Introduction for the error response format. |
404 | application/json | The decision could not be evaluated due to a nonexistent decision definition. See the Introduction for the error response format. |
500 | application/json | The decision could not be evaluated successfully. See the Introduction for the error response format. |
Example
Request
POST /decision-definition/aDecisionDefinitionId/evaluate
POST /decision-definition/key/aDecisionDefinitionKey/evaluate
Request body:
{
"variables" : {
"amount" : { "value" : 600, "type" : "Double" },
"invoiceCategory" : { "value" : "Misc", "type" : "String" }
}
}
Response
[
{
"result": { "value" : "management", "type" : "String", "valueInfo" : null }
}
]