This is an automated email from the ASF dual-hosted git repository.
gitgabrio pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git
The following commit(s) were added to refs/heads/main by this push:
new c66141b49 [incubator-kie-issues#1791] Moving evaluationHitIds map
inside JITDMNDecisionResult (#2185)
c66141b49 is described below
commit c66141b49a69da9a10b0707891f650f1cfa27248
Author: Gabriele Cardosi <[email protected]>
AuthorDate: Thu Feb 6 10:41:30 2025 +0100
[incubator-kie-issues#1791] Moving evaluationHitIds map inside
JITDMNDecisionResult (#2185)
* [incubator-kie-issues#1791] Moving evaluationHitIds map inside
JITDMNDecisionResult. Add/modify test
* [incubator-kie-issues#1791] Fixing serialization/deserialization. Adding
tests
* [incubator-kie-issues#1791] Fixing duplicated count of evaluation hit ids
---------
Co-authored-by: Gabriele-Cardosi <[email protected]>
---
.../kie/kogito/jitexecutor/dmn/DMNEvaluator.java | 7 +-
.../kie/kogito/jitexecutor/dmn/JITDMNListener.java | 23 +-
.../dmn/responses/JITDMNDecisionResult.java | 17 +
.../jitexecutor/dmn/responses/JITDMNResult.java | 23 +-
.../jitexecutor/dmn/JITDMNServiceImplTest.java | 191 ++++---
.../jitexecutor/dmn/api/JITDMNResourceTest.java | 66 ++-
.../dmn/responses/JITDMNDecisionResultTest.java | 86 +++
.../dmn/responses/JITDMNResultTest.java | 611 +++++++++++++++++++++
8 files changed, 932 insertions(+), 92 deletions(-)
diff --git
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
index 54840c86b..841e8d40a 100644
---
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
+++
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
@@ -120,12 +120,13 @@ public class DMNEvaluator {
DMNContext dmnContext =
new DynamicDMNContextBuilder(dmnRuntime.newContext(),
dmnModel).populateContextWith(context);
DMNResult dmnResult = dmnRuntime.evaluateAll(dmnModel, dmnContext);
- Optional<Map<String, Integer>> evaluationHitIds =
dmnRuntime.getListeners().stream()
+ Optional<Map<String, Map<String, Integer>>>
decisionEvaluationHitIdsMap = dmnRuntime.getListeners().stream()
.filter(JITDMNListener.class::isInstance)
.findFirst()
.map(JITDMNListener.class::cast)
- .map(JITDMNListener::getEvaluationHitIds);
- return new JITDMNResult(getNamespace(), getName(), dmnResult,
evaluationHitIds.orElse(Collections.emptyMap()));
+ .map(JITDMNListener::getDecisionEvaluationHitIdsMap);
+ return new JITDMNResult(getNamespace(), getName(), dmnResult,
+ decisionEvaluationHitIdsMap.orElse(Collections.emptyMap()));
}
}
diff --git
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/JITDMNListener.java
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/JITDMNListener.java
index 2da2e74e4..6b1fc2572 100644
---
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/JITDMNListener.java
+++
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/JITDMNListener.java
@@ -18,6 +18,8 @@
*/
package org.kie.kogito.jitexecutor.dmn;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -36,14 +38,14 @@ import org.slf4j.LoggerFactory;
public class JITDMNListener implements DMNRuntimeEventListener {
- private final Map<String, Integer> evaluationHitIds = new HashMap<>();
+ private final Map<String, Map<String, Integer>>
decisionEvaluationHitIdsMap = new HashMap<>();
private static final Logger LOGGER =
LoggerFactory.getLogger(JITDMNListener.class);
@Override
public void afterEvaluateDecisionTable(AfterEvaluateDecisionTableEvent
event) {
logEvent(event);
- event.getSelectedIds().forEach(s -> evaluationHitIds.compute(s, (k, v)
-> v == null ? 1 : v + 1));
+ populateDecisionAndEvaluationHitIdMaps(event.getNodeName(),
event.getSelectedIds());
}
@Override
@@ -79,11 +81,22 @@ public class JITDMNListener implements
DMNRuntimeEventListener {
@Override
public void afterConditionalEvaluation(AfterConditionalEvaluationEvent
event) {
logEvent(event);
- evaluationHitIds.compute(event.getExecutedId(), (k, v) -> v == null ?
1 : v + 1);
+ populateDecisionAndEvaluationHitIdMaps(event.getNodeName(),
Collections.singleton(event.getExecutedId()));
}
- public Map<String, Integer> getEvaluationHitIds() {
- return evaluationHitIds;
+ public Map<String, Map<String, Integer>> getDecisionEvaluationHitIdsMap() {
+ return decisionEvaluationHitIdsMap;
+ }
+
+ private void populateDecisionAndEvaluationHitIdMaps(String decisionName,
Collection<String> idsToStore) {
+ Map<String, Integer> evaluationHitIds;
+ if (decisionEvaluationHitIdsMap.containsKey(decisionName)) {
+ evaluationHitIds = decisionEvaluationHitIdsMap.get(decisionName);
+ } else {
+ evaluationHitIds = new HashMap<>();
+ decisionEvaluationHitIdsMap.put(decisionName, evaluationHitIds);
+ }
+ idsToStore.forEach(s -> evaluationHitIds.compute(s, (k, v) -> v ==
null ? 1 : v + 1));
}
private void logEvent(DMNEvent toLog) {
diff --git
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResult.java
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResult.java
index 7348a4dc9..5ff45c7ba 100644
---
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResult.java
+++
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResult.java
@@ -20,7 +20,9 @@ package org.kie.kogito.jitexecutor.dmn.responses;
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
import org.kie.dmn.api.core.DMNDecisionResult;
import org.kie.dmn.api.core.DMNMessage;
@@ -39,17 +41,24 @@ public class JITDMNDecisionResult implements Serializable,
private DecisionEvaluationStatus status;
+ private Map<String, Integer> evaluationHitIds;
+
public JITDMNDecisionResult() {
// Intentionally blank.
}
public static JITDMNDecisionResult of(DMNDecisionResult value) {
+ return of(value, Collections.emptyMap());
+ }
+
+ public static JITDMNDecisionResult of(DMNDecisionResult value, Map<String,
Integer> decisionEvaluationHitIdsMap) {
JITDMNDecisionResult res = new JITDMNDecisionResult();
res.decisionId = value.getDecisionId();
res.decisionName = value.getDecisionName();
res.setResult(value.getResult());
res.setMessages(value.getMessages());
res.status = value.getEvaluationStatus();
+ res.evaluationHitIds = decisionEvaluationHitIdsMap;
return res;
}
@@ -100,6 +109,14 @@ public class JITDMNDecisionResult implements Serializable,
}
}
+ public Map<String, Integer> getEvaluationHitIds() {
+ return evaluationHitIds;
+ }
+
+ public void setEvaluationHitIds(Map<String, Integer> evaluationHitIds) {
+ this.evaluationHitIds = evaluationHitIds;
+ }
+
@Override
public boolean hasErrors() {
return messages != null && messages.stream().anyMatch(m ->
m.getSeverity() == DMNMessage.Severity.ERROR);
diff --git
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResult.java
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResult.java
index c444dd014..9d388b172 100644
---
a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResult.java
+++
b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResult.java
@@ -50,8 +50,6 @@ public class JITDMNResult implements Serializable,
private Map<String, JITDMNDecisionResult> decisionResults = new
HashMap<>();
- private Map<String, Integer> evaluationHitIds;
-
public JITDMNResult() {
// Intentionally blank.
}
@@ -60,13 +58,12 @@ public class JITDMNResult implements Serializable,
this(namespace, modelName, dmnResult, Collections.emptyMap());
}
- public JITDMNResult(String namespace, String modelName,
org.kie.dmn.api.core.DMNResult dmnResult, Map<String, Integer>
evaluationHitIds) {
+ public JITDMNResult(String namespace, String modelName,
org.kie.dmn.api.core.DMNResult dmnResult, Map<String, Map<String, Integer>>
decisionEvaluationHitIdsMap) {
this.namespace = namespace;
this.modelName = modelName;
this.setDmnContext(dmnResult.getContext().getAll());
this.setMessages(dmnResult.getMessages());
- this.setDecisionResults(dmnResult.getDecisionResults());
- this.evaluationHitIds = evaluationHitIds;
+ this.internalSetDecisionResults(dmnResult.getDecisionResults(),
decisionEvaluationHitIdsMap);
}
public String getNamespace() {
@@ -110,14 +107,6 @@ public class JITDMNResult implements Serializable,
}
}
- public Map<String, Integer> getEvaluationHitIds() {
- return evaluationHitIds;
- }
-
- public void setEvaluationHitIds(Map<String, Integer> evaluationHitIds) {
- this.evaluationHitIds = evaluationHitIds;
- }
-
@JsonIgnore
@Override
public DMNContext getContext() {
@@ -167,7 +156,13 @@ public class JITDMNResult implements Serializable,
.append(", dmnContext=").append(dmnContext)
.append(", messages=").append(messages)
.append(", decisionResults=").append(decisionResults)
- .append(", evaluationHitIds=").append(evaluationHitIds)
.append("]").toString();
}
+
+ private void internalSetDecisionResults(List<? extends DMNDecisionResult>
decisionResults, Map<String, Map<String, Integer>> decisionEvaluationHitIdsMap)
{
+ this.decisionResults = new HashMap<>();
+ for (DMNDecisionResult dr : decisionResults) {
+ this.decisionResults.put(dr.getDecisionId(),
JITDMNDecisionResult.of(dr,
decisionEvaluationHitIdsMap.getOrDefault(dr.getDecisionName(),
Collections.emptyMap())));
+ }
+ }
}
diff --git
a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/JITDMNServiceImplTest.java
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/JITDMNServiceImplTest.java
index 0e627f7a3..de53596d6 100644
---
a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/JITDMNServiceImplTest.java
+++
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/JITDMNServiceImplTest.java
@@ -26,12 +26,13 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.kie.kogito.jitexecutor.dmn.responses.DMNResultWithExplanation;
+import org.kie.kogito.jitexecutor.dmn.responses.JITDMNDecisionResult;
import org.kie.kogito.jitexecutor.dmn.responses.JITDMNResult;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.kie.kogito.jitexecutor.dmn.TestingUtils.getModelFromIoUtils;
public class JITDMNServiceImplTest {
@@ -45,6 +46,57 @@ public class JITDMNServiceImplTest {
jitdmnService = new JITDMNServiceImpl(300, 1);
}
+ @Test
+ void testSampleModel() throws IOException {
+ final String ruleId0 = "_1FA12B9F-288C-42E8-B77F-BE2D3702B7B6";
+ final String ruleId1 = "_C8FA33B1-AF6E-4A59-B7B9-6FDF1F495C44";
+
+ String sampleModel =
getModelFromIoUtils("valid_models/DMNv1_5/Sample.dmn");
+ Map<String, Object> context = new HashMap<>();
+ context.put("Credit Score", Map.of("FICO", 700));
+
+ Map<String, Object> monthly = new HashMap<>();
+ monthly.put("Income", 121233);
+ monthly.put("Repayments", 33);
+ monthly.put("Expenses", 123);
+ monthly.put("Tax", 32);
+ monthly.put("Insurance", 55);
+ Map<String, Object> applicantData = new HashMap<>();
+ applicantData.put("Age", 32);
+ applicantData.put("Marital Status", "S");
+ applicantData.put("Employment Status", "Employed");
+ applicantData.put("Monthly", monthly);
+ context.put("Applicant Data", applicantData);
+
+ Map<String, Object> requestedProduct = new HashMap<>();
+ requestedProduct.put("Type", "Special Loan");
+ requestedProduct.put("Rate", 1);
+ requestedProduct.put("Term", 2);
+ requestedProduct.put("Amount", 333);
+ context.put("Requested Product", requestedProduct);
+
+ context.put("id", "_0A185BAC-7692-45FA-B722-7C86C626BD51");
+
+ JITDMNResult dmnResult = jitdmnService.evaluateModel(sampleModel,
context);
+
assertThat(dmnResult.getModelName()).isEqualTo("loan_pre_qualification");
+
assertThat(dmnResult.getNamespace()).isEqualTo("https://kie.apache.org/dmn/_857FE424-BEDA-4772-AB8E-2F4CDDB864AB");
+ assertThat(dmnResult.getMessages()).isEmpty();
+ assertThat(dmnResult.getDecisionResultByName("Front End
Ratio").getResult()).isEqualTo("Sufficient");
+ assertThat(dmnResult.getDecisionResultByName("Back End
Ratio").getResult()).isEqualTo("Sufficient");
+
+ JITDMNDecisionResult retrievedDecisionResult = (JITDMNDecisionResult)
dmnResult.getDecisionResultByName("Credit Score Rating");
+ assertThat(retrievedDecisionResult.getResult()).isEqualTo("Good");
+
+ Map<String, Integer> evaluationHitIds =
retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(ruleId0);
+
+ retrievedDecisionResult = (JITDMNDecisionResult)
dmnResult.getDecisionResultByName("Loan Pre-Qualification");
+ evaluationHitIds = retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(ruleId1);
+ }
+
@Test
void testModelEvaluation() {
Map<String, Object> context = new HashMap<>();
@@ -52,11 +104,10 @@ public class JITDMNServiceImplTest {
context.put("DTI Ratio", .1);
context.put("PITI Ratio", .1);
JITDMNResult dmnResult = jitdmnService.evaluateModel(model, context);
-
- Assertions.assertEquals("xls2dmn", dmnResult.getModelName());
-
Assertions.assertEquals("xls2dmn_741b355c-685c-4827-b13a-833da8321da4",
dmnResult.getNamespace());
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals("Approved",
dmnResult.getDecisionResultByName("Loan Approval").getResult());
+ assertThat(dmnResult.getModelName()).isEqualTo("xls2dmn");
+
assertThat(dmnResult.getNamespace()).isEqualTo("xls2dmn_741b355c-685c-4827-b13a-833da8321da4");
+ assertThat(dmnResult.getMessages()).isEmpty();
+ assertThat(dmnResult.getDecisionResultByName("Loan
Approval").getResult()).isEqualTo("Approved");
}
@Test
@@ -78,11 +129,10 @@ public class JITDMNServiceImplTest {
context.put("Bribe", 10);
JITDMNResult dmnResult =
jitdmnService.evaluateModel(decisionTableModel, context);
- Assertions.assertEquals("LoanEligibility", dmnResult.getModelName());
-
Assertions.assertEquals("https://github.com/kiegroup/kogito-examples/dmn-quarkus-listener-example",
- dmnResult.getNamespace());
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals("Yes",
dmnResult.getDecisionResultByName("Eligibility").getResult());
+ assertThat(dmnResult.getModelName()).isEqualTo("LoanEligibility");
+
assertThat(dmnResult.getNamespace()).isEqualTo("https://github.com/kiegroup/kogito-examples/dmn-quarkus-listener-example");
+ assertThat(dmnResult.getMessages()).isEmpty();
+
assertThat(dmnResult.getDecisionResultByName("Eligibility").getResult()).isEqualTo("Yes");
}
@Test
@@ -97,31 +147,41 @@ public class JITDMNServiceImplTest {
Map<String, Object> context = new HashMap<>();
context.put("Credit Score", "Poor");
context.put("DTI", 33);
- JITDMNResult dmnResult =
jitdmnService.evaluateModel(decisionTableModel, context);
-
- Assertions.assertEquals("DMN_A77074C1-21FE-4F7E-9753-F84661569AFC",
dmnResult.getModelName());
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals(BigDecimal.valueOf(50),
dmnResult.getDecisionResultByName("Risk Score").getResult());
- Map<String, Integer> evaluationHitIds =
dmnResult.getEvaluationHitIds();
- Assertions.assertNotNull(evaluationHitIds);
- Assertions.assertEquals(3, evaluationHitIds.size());
- Assertions.assertTrue(evaluationHitIds.containsKey(elseElementId));
- Assertions.assertTrue(evaluationHitIds.containsKey(ruleId0));
- Assertions.assertTrue(evaluationHitIds.containsKey(ruleId3));
-
+ JITDMNResult retrieved =
jitdmnService.evaluateModel(decisionTableModel, context);
+
assertThat(retrieved.getModelName()).isEqualTo("DMN_A77074C1-21FE-4F7E-9753-F84661569AFC");
+ assertThat(retrieved.getMessages()).isEmpty();
+
+ // Approved decision
+ JITDMNDecisionResult retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Risk Score");
+
assertThat(retrievedDecisionResult.getResult()).isEqualTo(BigDecimal.valueOf(50));
+
+ Map<String, Integer> evaluationHitIds =
retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(ruleId0, ruleId3);
+ // Not Qualified decision
+ retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Loan Pre-Qualification");
+ assertThat(retrievedDecisionResult.getResult()).isEqualTo("Not
Qualified");
+ evaluationHitIds = retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(elseElementId);
+ //---/
context = new HashMap<>();
context.put("Credit Score", "Excellent");
context.put("DTI", 10);
- dmnResult = jitdmnService.evaluateModel(decisionTableModel, context);
-
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals(BigDecimal.valueOf(20),
dmnResult.getDecisionResultByName("Risk Score").getResult());
- evaluationHitIds = dmnResult.getEvaluationHitIds();
- Assertions.assertNotNull(evaluationHitIds);
- Assertions.assertEquals(3, evaluationHitIds.size());
- Assertions.assertTrue(evaluationHitIds.containsKey(thenElementId));
- Assertions.assertTrue(evaluationHitIds.containsKey(ruleId1));
- Assertions.assertTrue(evaluationHitIds.containsKey(ruleId4));
+ retrieved = jitdmnService.evaluateModel(decisionTableModel, context);
+ assertThat(retrieved.getMessages()).isEmpty();
+ // Approved decision
+ retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Risk Score");
+
assertThat(retrievedDecisionResult.getResult()).isEqualTo(BigDecimal.valueOf(20));
+ evaluationHitIds = retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(ruleId1, ruleId4);
+ // Qualified decision
+ retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Loan Pre-Qualification");
+ assertThat(retrievedDecisionResult.getResult()).isEqualTo("Qualified");
+ evaluationHitIds = retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(thenElementId);
}
@Test
@@ -138,31 +198,27 @@ public class JITDMNServiceImplTest {
context.put("Credit Score", "Poor");
context.put("DTI", 33);
context.put("World Region", "Asia");
- JITDMNResult dmnResult =
jitdmnService.evaluateModel(decisionTableModel, context);
-
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals(BigDecimal.valueOf(50),
dmnResult.getDecisionResultByName("Risk Score").getResult());
- Map<String, Integer> evaluationHitIds =
dmnResult.getEvaluationHitIds();
- Assertions.assertNotNull(evaluationHitIds);
- Assertions.assertEquals(3, evaluationHitIds.size());
- Assertions.assertTrue(evaluationHitIds.containsKey(thenElementId));
- Assertions.assertTrue(evaluationHitIds.containsKey(thenRuleId0));
- Assertions.assertTrue(evaluationHitIds.containsKey(thenRuleId4));
-
+ JITDMNResult retrieved =
jitdmnService.evaluateModel(decisionTableModel, context);
+ assertThat(retrieved.getMessages()).isEmpty();
+ // Approved decision
+ JITDMNDecisionResult retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Risk Score");
+
assertThat(retrievedDecisionResult.getResult()).isEqualTo(BigDecimal.valueOf(50));
+ Map<String, Integer> evaluationHitIds =
retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(thenElementId, thenRuleId0, thenRuleId4);
+ //---/
context = new HashMap<>();
context.put("Credit Score", "Excellent");
context.put("DTI", 10);
context.put("World Region", "Europe");
- dmnResult = jitdmnService.evaluateModel(decisionTableModel, context);
-
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals(BigDecimal.valueOf(30),
dmnResult.getDecisionResultByName("Risk Score").getResult());
- evaluationHitIds = dmnResult.getEvaluationHitIds();
- Assertions.assertNotNull(evaluationHitIds);
- Assertions.assertEquals(3, evaluationHitIds.size());
- Assertions.assertTrue(evaluationHitIds.containsKey(elseElementId));
- Assertions.assertTrue(evaluationHitIds.containsKey(elseRuleId2));
- Assertions.assertTrue(evaluationHitIds.containsKey(elseRuleId5));
+ retrieved = jitdmnService.evaluateModel(decisionTableModel, context);
+ assertThat(retrieved.getMessages()).isEmpty();
+ // Approved decision
+ retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Risk Score");
+
assertThat(retrievedDecisionResult.getResult()).isEqualTo(BigDecimal.valueOf(30));
+ evaluationHitIds = retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsOnlyKeys(elseElementId, elseRuleId2, elseRuleId5);
}
@Test
@@ -178,20 +234,18 @@ public class JITDMNServiceImplTest {
numbers.add(BigDecimal.valueOf(1));
final Map<String, Object> context = new HashMap<>();
context.put("Numbers", numbers);
- final JITDMNResult dmnResult =
jitdmnService.evaluateModel(decisionTableModel, context);
+ final JITDMNResult retrieved =
jitdmnService.evaluateModel(decisionTableModel, context);
final List<BigDecimal> expectedStatistcs = new ArrayList<>();
expectedStatistcs.add(BigDecimal.valueOf(6));
expectedStatistcs.add(BigDecimal.valueOf(3));
expectedStatistcs.add(BigDecimal.valueOf(1));
- Assertions.assertTrue(dmnResult.getMessages().isEmpty());
- Assertions.assertEquals(expectedStatistcs,
dmnResult.getDecisionResultByName("Statistics").getResult());
- final Map<String, Integer> evaluationHitIds =
dmnResult.getEvaluationHitIds();
- Assertions.assertNotNull(evaluationHitIds);
- Assertions.assertEquals(3, evaluationHitIds.size());
- Assertions.assertEquals(3, evaluationHitIds.get(rule0));
- Assertions.assertEquals(2, evaluationHitIds.get(rule1));
- Assertions.assertEquals(1, evaluationHitIds.get(rule2));
+ assertThat(retrieved.getMessages()).isEmpty();
+ JITDMNDecisionResult retrievedDecisionResult = (JITDMNDecisionResult)
retrieved.getDecisionResultByName("Statistics");
+
assertThat(retrievedDecisionResult.getResult()).isEqualTo(expectedStatistcs);
+ Map<String, Integer> evaluationHitIds =
retrievedDecisionResult.getEvaluationHitIds();
+ assertThat(evaluationHitIds).isNotNull()
+ .containsExactlyInAnyOrderEntriesOf(Map.of(rule0, 3, rule1, 2,
rule2, 1));
}
@Test
@@ -221,12 +275,11 @@ public class JITDMNServiceImplTest {
context.put("listOfComplexInput",
Collections.singletonList(complexInput));
DMNResultWithExplanation response =
jitdmnService.evaluateModelAndExplain(allTypesModel, context);
+ assertThat(response.dmnResult).isNotNull();
+ assertThat(response.dmnResult.getDecisionResults()).hasSize(1);
- Assertions.assertNotNull(response.dmnResult);
- Assertions.assertEquals(1,
response.dmnResult.getDecisionResults().size());
-
- Assertions.assertNotNull(response.salienciesResponse);
- Assertions.assertEquals(1,
response.salienciesResponse.getSaliencies().size());
- Assertions.assertEquals(17,
response.salienciesResponse.getSaliencies().get(0).getFeatureImportance().size());
+ assertThat(response.salienciesResponse).isNotNull();
+ assertThat(response.salienciesResponse.getSaliencies()).hasSize(1);
+
assertThat(response.salienciesResponse.getSaliencies().get(0).getFeatureImportance()).hasSize(17);
}
}
diff --git
a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/api/JITDMNResourceTest.java
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/api/JITDMNResourceTest.java
index 99634d4d5..4f6be26da 100644
---
a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/api/JITDMNResourceTest.java
+++
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/api/JITDMNResourceTest.java
@@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
@@ -34,10 +36,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
+import io.restassured.response.Response;
+import io.restassured.response.ResponseBody;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.containsString;
@@ -79,6 +84,62 @@ public class JITDMNResourceTest {
.body(containsString("Loan Approval"),
containsString("Approved"));
}
+ @Test
+ void testjitSampleEndpoint() throws IOException {
+ final String ruleId0 = "_1FA12B9F-288C-42E8-B77F-BE2D3702B7B6";
+ final String ruleId1 = "_C8FA33B1-AF6E-4A59-B7B9-6FDF1F495C44";
+ String sampleModel =
getModelFromIoUtils("valid_models/DMNv1_5/Sample.dmn");
+ Map<String, Object> context = new HashMap<>();
+ context.put("Credit Score", Map.of("FICO", 700));
+
+ Map<String, Object> monthly = new HashMap<>();
+ monthly.put("Income", 121233);
+ monthly.put("Repayments", 33);
+ monthly.put("Expenses", 123);
+ monthly.put("Tax", 32);
+ monthly.put("Insurance", 55);
+ Map<String, Object> applicantData = new HashMap<>();
+ applicantData.put("Age", 32);
+ applicantData.put("Marital Status", "S");
+ applicantData.put("Employment Status", "Employed");
+ applicantData.put("Monthly", monthly);
+ context.put("Applicant Data", applicantData);
+
+ Map<String, Object> requestedProduct = new HashMap<>();
+ requestedProduct.put("Type", "Special Loan");
+ requestedProduct.put("Rate", 1);
+ requestedProduct.put("Term", 2);
+ requestedProduct.put("Amount", 333);
+ context.put("Requested Product", requestedProduct);
+
+ context.put("id", "_0A185BAC-7692-45FA-B722-7C86C626BD51");
+ JITDMNPayload jitdmnpayload = new JITDMNPayload(sampleModel, context);
+
+ Response response = given()
+ .contentType(ContentType.JSON)
+ .body(jitdmnpayload)
+ .when().post("/jitdmn/dmnresult");
+
+ ResponseBody body = response.getBody();
+ String responseString = body.asString();
+ JsonNode retrieved = MAPPER.readTree(responseString);
+ ArrayNode decisionResultsNode = (ArrayNode)
retrieved.get("decisionResults");
+ Iterable<JsonNode> iterable = () -> decisionResultsNode.elements();
+ Stream<JsonNode> targetStream =
StreamSupport.stream(iterable.spliterator(), false);
+ ObjectNode decisionNode = (ObjectNode) targetStream.filter(node ->
node.get("decisionName").asText().equals("Credit Score
Rating")).findFirst().get();
+ ObjectNode evaluationHitIdsNode = (ObjectNode)
decisionNode.get(EVALUATION_HIT_IDS_FIELD_NAME);
+ Assertions.assertThat(evaluationHitIdsNode).hasSize(1);
+ Map<String, Integer> expectedEvaluationHitIds0 = Map.of(ruleId0, 1);
+ evaluationHitIdsNode.fields().forEachRemaining(entry ->
Assertions.assertThat(expectedEvaluationHitIds0).containsEntry(entry.getKey(),
entry.getValue().asInt()));
+
+ targetStream = StreamSupport.stream(iterable.spliterator(), false);
+ decisionNode = (ObjectNode) targetStream.filter(node ->
node.get("decisionName").asText().equals("Loan
Pre-Qualification")).findFirst().get();
+ evaluationHitIdsNode = (ObjectNode)
decisionNode.get(EVALUATION_HIT_IDS_FIELD_NAME);
+ Assertions.assertThat(evaluationHitIdsNode).hasSize(1);
+ Map<String, Integer> expectedEvaluationHitIds1 = Map.of(ruleId1, 1);
+ evaluationHitIdsNode.fields().forEachRemaining(entry ->
Assertions.assertThat(expectedEvaluationHitIds1).containsEntry(entry.getKey(),
entry.getValue().asInt()));
+ }
+
@Test
void testjitdmnResultEndpoint() {
JITDMNPayload jitdmnpayload = new
JITDMNPayload(modelWithMultipleEvaluationHitIds, buildMultipleHitContext());
@@ -110,8 +171,11 @@ public class JITDMNResourceTest {
.extract()
.asString();
JsonNode retrieved = MAPPER.readTree(response);
- ObjectNode evaluationHitIdsNode = (ObjectNode)
retrieved.get(EVALUATION_HIT_IDS_FIELD_NAME);
+ ArrayNode decisionResultsNode = (ArrayNode)
retrieved.get("decisionResults");
+ ObjectNode decisionNode = (ObjectNode) decisionResultsNode.get(0);
+ ObjectNode evaluationHitIdsNode = (ObjectNode)
decisionNode.get(EVALUATION_HIT_IDS_FIELD_NAME);
Assertions.assertThat(evaluationHitIdsNode).hasSize(3);
+
final Map<String, Integer> expectedEvaluationHitIds = Map.of(rule0, 3,
rule1, 2, rule2, 1);
evaluationHitIdsNode.fields().forEachRemaining(entry ->
Assertions.assertThat(expectedEvaluationHitIds).containsEntry(entry.getKey(),
entry.getValue().asInt()));
}
diff --git
a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResultTest.java
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResultTest.java
new file mode 100644
index 000000000..8274fb35b
--- /dev/null
+++
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNDecisionResultTest.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.jitexecutor.dmn.responses;
+
+import org.junit.jupiter.api.Test;
+import org.kie.dmn.api.core.DMNDecisionResult;
+import org.kie.dmn.api.core.DMNMessage;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class JITDMNDecisionResultTest {
+
+ private static final ObjectMapper MAPPER;
+ static {
+ final var jitModule = new SimpleModule()
+ .addAbstractTypeMapping(DMNDecisionResult.class,
JITDMNDecisionResult.class)
+ .addAbstractTypeMapping(DMNMessage.class, JITDMNMessage.class);
+
+ MAPPER = new ObjectMapper()
+ .registerModule(new Jdk8Module())
+ .registerModule(jitModule);
+ MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
+ }
+
+ @Test
+ void deserialize() throws JsonProcessingException {
+ String json = "{\n" +
+ " \"decisionId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"decisionName\": \"Adjudication\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Adjudication' as it depends on decision 'Routing'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Supporting
documents' not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " }";
+ JITDMNDecisionResult retrieved = MAPPER.readValue(json,
JITDMNDecisionResult.class);
+ assertThat(retrieved).isNotNull();
+ }
+
+}
diff --git
a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResultTest.java
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResultTest.java
new file mode 100644
index 000000000..f14d8b3a1
--- /dev/null
+++
b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/responses/JITDMNResultTest.java
@@ -0,0 +1,611 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.jitexecutor.dmn.responses;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.kie.api.io.Resource;
+import org.kie.dmn.api.core.DMNContext;
+import org.kie.dmn.api.core.DMNDecisionResult;
+import org.kie.dmn.api.core.DMNMessage;
+import org.kie.dmn.api.core.DMNModel;
+import org.kie.dmn.api.core.DMNResult;
+import org.kie.dmn.api.core.DMNRuntime;
+import org.kie.dmn.core.impl.DMNContextImpl;
+import org.kie.dmn.core.impl.DMNResultImpl;
+import org.kie.dmn.core.internal.utils.DMNRuntimeBuilder;
+import org.kie.internal.io.ResourceFactory;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.kie.kogito.jitexecutor.dmn.TestingUtils.getModelFromIoUtils;
+
+class JITDMNResultTest {
+
+ private static final ObjectMapper MAPPER;
+ private static DMNModel DMN_MODEL;
+ static {
+ final var jitModule = new
SimpleModule().addAbstractTypeMapping(DMNResult.class, JITDMNResult.class)
+ .addAbstractTypeMapping(DMNDecisionResult.class,
JITDMNDecisionResult.class)
+ .addAbstractTypeMapping(DMNMessage.class, JITDMNMessage.class);
+
+ MAPPER = new ObjectMapper()
+ .registerModule(new Jdk8Module())
+ .registerModule(jitModule);
+ MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
+ }
+
+ @BeforeAll
+ static void setup() throws IOException {
+ String modelXML =
getModelFromIoUtils("valid_models/DMNv1_5/Sample.dmn");
+ Resource modelResource = ResourceFactory.newReaderResource(new
StringReader(modelXML), "UTF-8");
+ DMNRuntime dmnRuntime =
DMNRuntimeBuilder.fromDefaults().buildConfiguration()
+
.fromResources(Collections.singletonList(modelResource)).getOrElseThrow(RuntimeException::new);
+ DMN_MODEL = dmnRuntime.getModels().get(0);
+ }
+
+ @Test
+ void serializeDeserialize() throws JsonProcessingException {
+ JITDMNDecisionResult decisionResult = getJITDMNDecisionResult();
+ DMNResultImpl dmnResult = new DMNResultImpl(DMN_MODEL);
+ dmnResult.setContext(createContext());
+ dmnResult.addDecisionResult(decisionResult);
+
+ JITDMNResult jitdmnResult = new
JITDMNResult("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4",
"Chapter 11 Example", dmnResult);
+ String retrieved = MAPPER.writeValueAsString(jitdmnResult);
+ assertThat(retrieved).isNotNull().isNotBlank();
+ System.out.println(retrieved);
+ JITDMNResult result = MAPPER.readValue(retrieved, JITDMNResult.class);
+ assertThat(result).isNotNull();
+ }
+
+ @Test
+ void deserialize() throws JsonProcessingException {
+ String json = "{\n" +
+ " \"namespace\":
\"http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4\",\n"
+
+ " \"modelName\": \"Chapter 11 Example\",\n" +
+ " \"dmnContext\": {\n" +
+ " \"Pre-bureau risk category table\": \"function Pre-bureau
risk category table( Existing Customer, Application Risk Score )\",\n" +
+ " \"Installment calculation\": \"function Installment
calculation( Product Type, Rate, Term, Amount )\",\n" +
+ " \"Bureau call type table\": \"function Bureau call type
table( Pre-Bureau Risk Category )\",\n" +
+ " \"Application risk score model\": \"function Application
risk score model( Age, Marital Status, Employment Status )\",\n" +
+ " \"Routing rules\": \"function Routing rules( Post-bureau
risk category, Post-bureau affordability, Bankrupt, Credit score )\",\n" +
+ " \"Financial\": {\n" +
+ " \"PMT\": \"function PMT( Rate, Term, Amount )\"\n" +
+ " },\n" +
+ " \"Requested product\": {\n" +
+ " \"Rate\": 0.08,\n" +
+ " \"Amount\": 10000,\n" +
+ " \"ProductType\": \"STANDARD LOAN\",\n" +
+ " \"Term\": 36\n" +
+ " },\n" +
+ " \"Credit contingency factor table\": \"function Credit
contingency factor table( Risk Category )\",\n" +
+ " \"Affordability calculation\": \"function Affordability
calculation( Monthly Income, Monthly Repayments, Monthly Expenses, Risk
Category, Required Monthly Installment )\",\n" +
+ " \"Post-bureau risk category table\": \"function
Post-bureau risk category table( Existing Customer, Application Risk Score,
Credit Score )\",\n" +
+ " \"Required monthly installment\":
333.3636546143084985132842970339110,\n" +
+ " \"Bureau data\": {\n" +
+ " \"Bankrupt\": false,\n" +
+ " \"CreditScore\": 600\n" +
+ " },\n" +
+ " \"Eligibility rules\": \"function Eligibility rules(
Pre-Bureau Risk Category, Pre-Bureau Affordability, Age )\"\n" +
+ " },\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_9997fcfd-0f50-4933-939e-88a235b5e2a0\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Application risk score'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_e905f02c-c5d9-4f2a-ba57-7912ff523b46\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Pre-bureau
risk category' as it depends on decision 'Application risk score'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_9997fcfd-0f50-4933-939e-88a235b5e2a0\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Bureau call
type' as it depends on decision 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_5b8356f3-2cf2-40e8-8f80-324937e8b276\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Strategy'
as it depends on decision 'Bureau call type'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_8b838f06-968a-4c66-875e-f5412fd692cf\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Eligibility' as it depends on decision 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Eligibility'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Pre-bureau
affordability' as it depends on decision 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ed60265c-25e2-400f-a99f-fafd3b489838\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Pre-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ed60265c-25e2-400f-a99f-fafd3b489838\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Eligibility' as it depends on decision 'Pre-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Strategy'
as it depends on decision 'Eligibility'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_8b838f06-968a-4c66-875e-f5412fd692cf\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Post-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_40b45659-9299-43a6-af30-04c948c5c0ec\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Post-bureau
risk category' as it depends on decision 'Application risk score'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_40b45659-9299-43a6-af30-04c948c5c0ec\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Post-bureau
affordability' as it depends on decision 'Post-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_728e3a50-f00f-42c0-b3ee-1ee5aabd5474\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Post-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_728e3a50-f00f-42c0-b3ee-1ee5aabd5474\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Routing' as
it depends on decision 'Post-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ca1e6032-12eb-428a-a80b-49028a88c0b5\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Routing' as
it depends on decision 'Post-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ca1e6032-12eb-428a-a80b-49028a88c0b5\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data' not
found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Adjudication' as it depends on decision 'Routing'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Supporting
documents' not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter 11
Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"decisionResults\": [\n" +
+ " {\n" +
+ " \"decisionId\":
\"_5b8356f3-2cf2-40e8-8f80-324937e8b276\",\n" +
+ " \"decisionName\": \"Bureau call type\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision 'Bureau
call type' as it depends on decision 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_5b8356f3-2cf2-40e8-8f80-324937e8b276\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"decisionName\": \"Eligibility\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Eligibility' as it depends on decision 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Eligibility'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Eligibility' as it depends on decision 'Pre-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_b5e759df-f662-44cd-94f5-55c3c81f0ee3\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"decisionName\": \"Adjudication\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Adjudication' as it depends on decision 'Routing'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Supporting
documents' not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_e905f02c-c5d9-4f2a-ba57-7912ff523b46\",\n" +
+ " \"decisionName\": \"Application risk score\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Application risk score'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_e905f02c-c5d9-4f2a-ba57-7912ff523b46\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_ed60265c-25e2-400f-a99f-fafd3b489838\",\n" +
+ " \"decisionName\": \"Pre-bureau affordability\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Pre-bureau affordability' as it depends on decision 'Pre-bureau risk
category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ed60265c-25e2-400f-a99f-fafd3b489838\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Pre-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ed60265c-25e2-400f-a99f-fafd3b489838\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_40b45659-9299-43a6-af30-04c948c5c0ec\",\n" +
+ " \"decisionName\": \"Post-bureau risk category\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Post-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_40b45659-9299-43a6-af30-04c948c5c0ec\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Post-bureau risk category' as it depends on decision 'Application risk
score'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_40b45659-9299-43a6-af30-04c948c5c0ec\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_728e3a50-f00f-42c0-b3ee-1ee5aabd5474\",\n" +
+ " \"decisionName\": \"Post-bureau affordability\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Post-bureau affordability' as it depends on decision 'Post-bureau risk
category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_728e3a50-f00f-42c0-b3ee-1ee5aabd5474\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Post-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_728e3a50-f00f-42c0-b3ee-1ee5aabd5474\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_3c8cee68-99dd-418c-847d-0b54697354f2\",\n" +
+ " \"decisionName\": \"Required monthly installment\",\n" +
+ " \"result\": 333.3636546143084985132842970339110,\n" +
+ " \"messages\": [],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SUCCEEDED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_ca1e6032-12eb-428a-a80b-49028a88c0b5\",\n" +
+ " \"decisionName\": \"Routing\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Routing' as it depends on decision 'Post-bureau affordability'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ca1e6032-12eb-428a-a80b-49028a88c0b5\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Routing' as it depends on decision 'Post-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_ca1e6032-12eb-428a-a80b-49028a88c0b5\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_9997fcfd-0f50-4933-939e-88a235b5e2a0\",\n" +
+ " \"decisionName\": \"Pre-bureau risk category\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Pre-bureau risk category'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_9997fcfd-0f50-4933-939e-88a235b5e2a0\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Pre-bureau risk category' as it depends on decision 'Application risk
score'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_9997fcfd-0f50-4933-939e-88a235b5e2a0\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"decisionId\":
\"_8b838f06-968a-4c66-875e-f5412fd692cf\",\n" +
+ " \"decisionName\": \"Strategy\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Strategy' as it depends on decision 'Bureau call type'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_8b838f06-968a-4c66-875e-f5412fd692cf\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Strategy' as it depends on decision 'Eligibility'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_8b838f06-968a-4c66-875e-f5412fd692cf\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " }\n" +
+ " ]\n" +
+ "}";
+ JITDMNResult result = MAPPER.readValue(json, JITDMNResult.class);
+ assertThat(result).isNotNull();
+ }
+
+ private DMNContext createContext() {
+ Map<String, Object> contextMap = new HashMap<>();
+ contextMap.put("Credit Score", Map.of("FICO", 700));
+
+ Map<String, Object> monthly = new HashMap<>();
+ monthly.put("Income", 121233);
+ monthly.put("Repayments", 33);
+ monthly.put("Expenses", 123);
+ monthly.put("Tax", 32);
+ monthly.put("Insurance", 55);
+ Map<String, Object> applicantData = new HashMap<>();
+ applicantData.put("Age", 32);
+ applicantData.put("Marital Status", "S");
+ applicantData.put("Employment Status", "Employed");
+ applicantData.put("Monthly", monthly);
+ contextMap.put("Applicant Data", applicantData);
+
+ Map<String, Object> requestedProduct = new HashMap<>();
+ requestedProduct.put("Type", "Special Loan");
+ requestedProduct.put("Rate", 1);
+ requestedProduct.put("Term", 2);
+ requestedProduct.put("Amount", 333);
+ contextMap.put("Requested Product", requestedProduct);
+
+ contextMap.put("id", "_0A185BAC-7692-45FA-B722-7C86C626BD51");
+ return new DMNContextImpl(contextMap);
+ }
+
+ private JITDMNDecisionResult getJITDMNDecisionResult() throws
JsonProcessingException {
+ String json = "{\n" +
+ " \"decisionId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"decisionName\": \"Adjudication\",\n" +
+ " \"result\": null,\n" +
+ " \"messages\": [\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Applicant data'
not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Unable to evaluate decision
'Adjudication' as it depends on decision 'Routing'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"severity\": \"ERROR\",\n" +
+ " \"message\": \"Required dependency 'Supporting
documents' not found on node 'Adjudication'\",\n" +
+ " \"messageType\": \"REQ_NOT_FOUND\",\n" +
+ " \"sourceId\":
\"_4bd33d4a-741b-444a-968b-64e1841211e7\",\n" +
+ " \"path\": \"invalid_models/DMNv1_x/multiple/Chapter
11 Example.dmn\",\n" +
+ " \"level\": \"ERROR\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"evaluationHitIds\": {},\n" +
+ " \"evaluationStatus\": \"SKIPPED\"\n" +
+ " }";
+ return MAPPER.readValue(json, JITDMNDecisionResult.class);
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]