jomarko commented on code in PR #2120:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/2120#discussion_r1808563232
##########
jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java:
##########
@@ -22,7 +22,10 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
Review Comment:
this is maybe unused now?
##########
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:
`emptyList`
--
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]