-
Feature Request
-
Resolution: Duplicate
-
L3 - Default
-
None
-
None
User Story (Required on creation):
After evaluating a decision definition via API (Java or REST), I want to find all decision instances that were involved in creating the result of the evaluation. Since all involved elements are connected by a root decision instance ID, I want to receive this ID together with the evaluation result to allow querying with this later on.
Functional Requirements (Required before implementation):
- Receive an identifier in the evaluation result that allows searching for all involved decision instances
Technical Requirements (Required before implementation):
- Return a unique id in the decision evaluation result that is attached to all involved decision instances - the rootDecisionInstanceId of the historic decision instance events looks like a suitable candidate here.
Limitations of Scope (Optional):
- This will only work when an appropriate history level is set in the engine configuration
Hints (optional):
- By returning the rootDecisionInstanceId, we can reuse the historic decision instance search with a rootDecisionInstanceId parameter to find all involved elements.
This is the controller panel for Smart Panels app
[CAM-14351] Return top-level decision instance id in evaluation result
Assignee | New: Tobias Metzke-Bernstein [ tobias.metzke ] |
Link | New: This issue is related to CAMTEAM-221 [ CAMTEAM-221 ] |
Mentioned Roles |
Mentioned Groups |
Mentioned Roles |
Mentioned Groups |
Description |
Original:
h3. User Story (Required on creation):
As a developer, I need the root DecisionInstanceId returned to me when I request an evaluation of a decision-instance through the api (Java or REST) so that I can store that information in my application for later use in pulling historical information on the decision through the History API using the rootDecisionInstanceId query parameter h3. Functional Requirements (Required before implementation): h3. Technical Requirements (Required before implementation): h3. Limitations of Scope (Optional): h3. Hints (optional): |
New:
h3. User Story (Required on creation):
As a developer, I need the root DecisionInstanceId returned to me when I request an evaluation of a decision-instance through the api (Java or REST) so that I can store that information in my application for later use in pulling historical information on the decision through the History API using the rootDecisionInstanceId query parameter h3. Functional Requirements (Required before implementation): Currently the REST API {\{baseUrl}}/decision-definition/key/:id/evaluate returns the following: [ { "result": { "type": "String", "value": "management", "valueInfo": {} } } ] What needs to be returned is [ { "rootDecisionInstanceId": "4bff743a-989e-11ec-84e8-5065f3453a1b", "result": { "type": "String", "value": "management", "valueInfo": {} } } ] I can store the rootDecisionInstanceID in my application so that when I need to interrogate how the decision was made from the application (to present the information to the user in the UI)... Then I can use that Root Decision Instance ID in the History API like this.. {\{baseUrl}}/history/decision-instance?includeInputs=true&includeOutputs=true&rootDecisionInstanceId=4bff743a-989e-11ec-84e8-5065f3453a1b Which will return the details of the decision: [ { "id": "4bff743a-989e-11ec-84e8-5065f3453a1b", "decisionDefinitionId": "invoice-assign-approver:2:911c7a4e-8826-11ec-923c-5065f3453a1b", "decisionDefinitionKey": "invoice-assign-approver", "decisionDefinitionName": "Assign Approver Group", "evaluationTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "processDefinitionId": null, "processDefinitionKey": null, "processInstanceId": null, "rootProcessInstanceId": null, "caseDefinitionId": null, "caseDefinitionKey": null, "caseInstanceId": null, "activityId": null, "activityInstanceId": null, "userId": null, "inputs": [ { "type": "String", "value": "budget", "valueInfo": {}, "id": "4bff9b4b-989e-11ec-84e8-5065f3453a1b", "decisionInstanceId": "4bff743a-989e-11ec-84e8-5065f3453a1b", "clauseId": "InputClause_0og2hn3", "clauseName": "Invoice Classification", "errorMessage": null, "createTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "rootProcessInstanceId": null } ], "outputs": [ { "type": "String", "value": "management", "valueInfo": {}, "id": "4bff9b4c-989e-11ec-84e8-5065f3453a1b", "decisionInstanceId": "4bff743a-989e-11ec-84e8-5065f3453a1b", "clauseId": "OutputClause_1cthd0w", "clauseName": "Approver Group", "ruleId": "row-49839158-5", "ruleOrder": 1, "variableName": "result", "errorMessage": null, "createTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "rootProcessInstanceId": null } ], "collectResultValue": null, "rootDecisionInstanceId": null, "decisionRequirementsDefinitionId": "invoiceBusinessDecisions:2:911c533c-8826-11ec-923c-5065f3453a1b", "decisionRequirementsDefinitionKey": "invoiceBusinessDecisions", "tenantId": null }, { "id": "4bff9b4d-989e-11ec-84e8-5065f3453a1b", "decisionDefinitionId": "invoiceClassification:2:911c533d-8826-11ec-923c-5065f3453a1b", "decisionDefinitionKey": "invoiceClassification", "decisionDefinitionName": "Invoice Classification", "evaluationTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "processDefinitionId": null, "processDefinitionKey": null, "processInstanceId": null, "rootProcessInstanceId": null, "caseDefinitionId": null, "caseDefinitionKey": null, "caseInstanceId": null, "activityId": null, "activityInstanceId": null, "userId": null, "inputs": [ { "type": "String", "value": "Misc", "valueInfo": {}, "id": "4bff9b4f-989e-11ec-84e8-5065f3453a1b", "decisionInstanceId": "4bff9b4d-989e-11ec-84e8-5065f3453a1b", "clauseId": "InputClause_15qmk0v", "clauseName": "Invoice Category", "errorMessage": null, "createTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "rootProcessInstanceId": null }, { "type": "Double", "value": 600.0, "valueInfo": {}, "id": "4bff9b4e-989e-11ec-84e8-5065f3453a1b", "decisionInstanceId": "4bff9b4d-989e-11ec-84e8-5065f3453a1b", "clauseId": "clause1", "clauseName": "Invoice Amount", "errorMessage": null, "createTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "rootProcessInstanceId": null } ], "outputs": [ { "type": "String", "value": "budget", "valueInfo": {}, "id": "4bff9b50-989e-11ec-84e8-5065f3453a1b", "decisionInstanceId": "4bff9b4d-989e-11ec-84e8-5065f3453a1b", "clauseId": "clause3", "clauseName": "Classification", "ruleId": "DecisionRule_1ak4z14", "ruleOrder": 1, "variableName": "invoiceClassification", "errorMessage": null, "createTime": "2022-02-28T07:56:58.893-0600", "removalTime": null, "rootProcessInstanceId": null } ], "collectResultValue": null, "rootDecisionInstanceId": "4bff743a-989e-11ec-84e8-5065f3453a1b", "decisionRequirementsDefinitionId": "invoiceBusinessDecisions:2:911c533c-8826-11ec-923c-5065f3453a1b", "decisionRequirementsDefinitionKey": "invoiceBusinessDecisions", "tenantId": null } ] h3. Technical Requirements (Required before implementation): h3. Limitations of Scope (Optional): h3. Hints (optional): |
Mentioned Roles |
Hi dgilmour22,
thanks for your proposal!
We will have a look at it as soon as possible and update the ticket with any feedback we have.
Best,
Tobias