jomarko commented on code in PR #6213:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6213#discussion_r1916102634


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/IsFunction.java:
##########
@@ -45,7 +46,7 @@ public FEELFnResult<Boolean> invoke(@ParameterName("value1") 
Object value1, @Par
                 return 
FEELFnResult.ofResult(BooleanEvalHelper.isEqualDateTimeInSemanticD(left, 
right));
             } // fallback; continue:
         }
-        Boolean fallback = BooleanEvalHelper.isEqual(value1, value2); // if 
null implying they are not the same semantic domain value.
+        Boolean fallback = BooleanEvalHelper.isEqual(value1, value2, 
FEELDialect.FEEL); // if null implying they are not the same semantic domain 
value.

Review Comment:
   Does have `is` same behavior for `FEEL` and `BFEEL`? In other places I saw 
ve have on similar place code like `ctx.getDialect()`, not needed here?



##########
kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/B-FEEL/BFeelChecks.dmn:
##########
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+
+<dmn:definitions 
xmlns="http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442";
+                      xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/";
+                      xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/";
+                      
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/";
+                      
xmlns:feel="https://www.omg.org/spec/DMN/20240513/B-FEEL/";
+                      xmlns:dmn="https://www.omg.org/spec/DMN/20230324/MODEL/";
+                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+                      exporter="DMN Modeler"
+                      exporterVersion="5.1.10.201705011622"
+                      id="_238bd96d-47cd-4746-831b-504f3e77b442"
+                      name="BFEELChecks"
+                      
expressionLanguage="https://www.omg.org/spec/DMN/20240513/B-FEEL/";
+                      
namespace="http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442";>
+   <dmn:itemDefinition id="_7EC734D9-5C1C-4135-AD0C-859B5D6ABE07" name="user" 
isCollection="false">
+      <dmn:typeRef>string</dmn:typeRef>
+   </dmn:itemDefinition>
+   <dmn:itemDefinition id="_7EC734D9-5C1C-4135-AD0C-859B5D6ABE08" 
name="splitteduser" isCollection="true">
+      <dmn:typeRef>string</dmn:typeRef>
+   </dmn:itemDefinition>
+   <dmn:inputData id="_DBC698E3-45FC-4D92-A1EC-B8C34629C259" name="user">
+      <dmn:extensionElements/>
+      <dmn:variable id="_31DB70CD-2342-4AA9-81D1-D14A37118AB3" name="user" 
typeRef="user"/>
+   </dmn:inputData>
+   <dmn:decision id="_F8CA8F98-EE6D-4D56-BCA0-1C716FAC2056" name="Decision1">
+      <dmn:extensionElements/>
+      <dmn:variable id="_C932A158-30E0-438B-8930-5704002CEA96" 
name="Decision1" typeRef="boolean"/>
+      <dmn:informationRequirement id="_B3961DA9-EB27-41E0-AAF2-386084E9E5FF">
+         <dmn:requiredInput href="#_DBC698E3-45FC-4D92-A1EC-B8C34629C259"/>
+      </dmn:informationRequirement>
+      <dmn:literalExpression id="_4B499A2E-513E-4938-8C74-C06E7DF47C72">
+         <dmn:text>user = 1</dmn:text>
+      </dmn:literalExpression>
+   </dmn:decision>
+   <dmn:decision id="_F8CA8F98-EE6D-4D56-BCA0-1C716FAC2057" name="Decision2">
+      <dmn:extensionElements/>
+      <dmn:variable id="_C932A158-30E0-438B-8930-5704002CEA97" 
name="Decision2" typeRef="boolean"/>
+      <dmn:informationRequirement id="_B3961DA9-EB27-41E0-AAF2-386084E9E600">
+         <dmn:requiredInput href="#_DBC698E3-45FC-4D92-A1EC-B8C34629C259"/>
+      </dmn:informationRequirement>
+      <dmn:literalExpression id="_4B499A2E-513E-4938-8C74-C06E7DF47C73">
+         <dmn:text>user = 1</dmn:text>

Review Comment:
   both `Decision1` and `Decision2` uses the same expression `user = 1` what 
does not bring much from test point of view:
   ```
           final DMNContext ctx1 = runtime.newContext();
           ctx1.set("user", "a");
           final DMNResult dmnResult1 = runtime.evaluateAll(dmnModel, ctx1);
           
assertThat(dmnResult1.getDecisionResultByName("Decision1").getResult()).isEqualTo(false);
           
assertThat(dmnResult1.getDecisionResultByName("Decision2").getResult()).isEqualTo(false);
           
assertThat(dmnResult1.getDecisionResultByName("Decision3").getResult()).isEqualTo(Collections.emptyList());
   ```
   
   I think we should either change one expression to like:
   - `user = [true|false]`
   - `user = [date expression]`
   - `user = [collection]`
   - ....
   
   Or we should remove one of the nodes `Decision1`, `Decision2`



##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/ListContainsFunction.java:
##########
@@ -56,7 +57,8 @@ public static boolean itemEqualsSC(Object value, Object 
itemFromList) {
         if (value instanceof String) {
             return value.equals(itemFromList);
         } else {
-            Boolean dmnEqual = BooleanEvalHelper.isEqual(value, itemFromList);
+            // Defaulting FEELDialect to FEEL
+            Boolean dmnEqual = BooleanEvalHelper.isEqual(value, itemFromList, 
FEELDialect.FEEL);

Review Comment:
   `list contains` can not be used with `BFEEL`? I do not know `drools` 
codebase os much but in `ListContainsFunction.java` it seems no mention of 
`BFEEL`.



-- 
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]

Reply via email to