gitgabrio commented on code in PR #2120:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/2120#discussion_r1808750002
##########
jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java:
##########
@@ -73,9 +78,16 @@ public Collection<DMNModel> getAllDMNModels() {
return dmnRuntime.getModels();
}
- public DMNResult evaluate(Map<String, Object> context) {
- DMNContext dmnContext = new
DynamicDMNContextBuilder(dmnRuntime.newContext(),
dmnModel).populateContextWith(context);
- return dmnRuntime.evaluateAll(dmnModel, dmnContext);
+ public JITDMNResult evaluate(Map<String, Object> context) {
+ DMNContext dmnContext =
+ new DynamicDMNContextBuilder(dmnRuntime.newContext(),
dmnModel).populateContextWith(context);
+ DMNResult dmnResult = dmnRuntime.evaluateAll(dmnModel, dmnContext);
+ Optional<List<String>> evaluationHitIds =
dmnRuntime.getListeners().stream()
+ .filter(JITDMNListener.class::isInstance)
+ .findFirst()
+ .map(JITDMNListener.class::cast)
+ .map(JITDMNListener::getEvaluationHitIds);
+ return new JITDMNResult(getNamespace(), getName(), dmnResult,
evaluationHitIds.orElse(Collections.emptySet()));
Review Comment:
Thanks for spotting!
--
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]