ChinchuAjith commented on code in PR #6556:
URL:
https://github.com/apache/incubator-kie-drools/pull/6556#discussion_r2715453422
##########
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableHitPolicyTest.java:
##########
@@ -66,14 +66,15 @@ void simpleDecisionTableHitPolicyUniqueSatisfies(boolean
useExecModelCompiler) {
assertThat(dmnModel).isNotNull();
// Risk Category is constrained to "High", "Low", "Medium" and "ASD"
is not allowed
+ // In lenient mode (default), invalid input is set to null and
evaluation continues
final DMNContext context =
getSimpleTableContext(BigDecimal.valueOf(18), "ASD", false);
final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context);
final DMNContext result = dmnResult.getContext();
- assertThat(result.get("Approval Status")).isNull();
- assertThat(dmnResult.getMessages()).hasSizeGreaterThan(0);
- DMNMessage message = dmnResult.getMessages().iterator().next();
- assertThat(message.getText()).isEqualTo("DMN: RiskCategory='ASD' does
not match any of the valid values \"High\", \"Low\", \"Medium\" for decision
table '_0004-simpletable-U'. (DMN id: _0004-simpletable-U, FEEL expression
evaluation error) ");
+ // In lenient mode, the decision table evaluates with null parameter
and returns a result
+ assertThat(result.get("Approval Status")).isEqualTo("Declined");
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]