You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "konB00yay (via GitHub)" <gi...@apache.org> on 2025/04/25 21:12:11 UTC

[PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

konB00yay opened a new pull request, #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324

   Fixes https://github.com/apache/incubator-kie-drools/issues/6323


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco commented on PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#issuecomment-2846594379

   Replaced by https://github.com/apache/incubator-kie-drools/pull/6330


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "konB00yay (via GitHub)" <gi...@apache.org>.
konB00yay commented on PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#issuecomment-2839955306

   > @konB00yay Than you for filing the GH issue and this PR.
   > 
   > It's great that you provided the unit test. Could you also share an example rule (not only the expression) which you hit the issue? Per my understanding, this issue is about the order in `MethodCallExpr.childNodes` while the order in `MethodCallExpr.arguments` is correct. So there might be a problem where drools should use `MethodCallExpr.arguments` instead of `MethodCallExpr.childNodes`.
   
   A new test file has been added with a drl rule which encounters the following exception without the change to DrlxParseUtils:
   
   ```
   MixedArgumentTest.mixedArgumentsTest:64->BaseModelTest.getKieSession:91->BaseModelTest.getKieSession:96->BaseModelTest.getKieContainer:100->BaseModelTest.getKieContainer:107->BaseModelTest.createKieBuilder:118->BaseModelTest.createKieBuilder:143 [Message [id=1, level=ERROR, path=src/main/java/mixedarguments/RulesE10E0A59478B34E2B90BAC9D05E4B593RuleMethods0.java, line=32, column=3267
      text=The method from(Variable<A>, Variable<B>, Variable<C>, Variable<D>, Function4<A,B,C,D,?>) in the type DSL is not applicable for the arguments (Variable<Child>, Variable<Child>, Variable<Person>, Variable<Person>, LambdaExtractorF011A3D197DF281A4A623392B55E265A)], Message [id=2, level=ERROR, path=src/main/java/mixedarguments/RulesE10E0A59478B34E2B90BAC9D05E4B593RuleMethods0.java, line=0, column=0
      text=Java source of src/main/java/mixedarguments/RulesE10E0A59478B34E2B90BAC9D05E4B593RuleMethods0.java in error:
   package mixedarguments;
   ```
   


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#issuecomment-2841242153

   @konB00yay Thank you! I'll get back to you soon.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#issuecomment-2834734446

   @konB00yay Than you for filing the GH issue and this PR.
   
   It's great that you provided the unit test. Could you also share an example rule (not only the expression) which you hit the issue? Per my understanding, this issue is about the order in `MethodCallExpr.childNodes` while the order in `MethodCallExpr.arguments` is correct. So there might be a problem where drools should use `MethodCallExpr.arguments` instead of `MethodCallExpr.childNodes`.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco closed pull request #6324: Fixing issue #6323 preserving argument order
URL: https://github.com/apache/incubator-kie-drools/pull/6324


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#discussion_r2062952523


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/generator/DrlxParseUtilTest.java:
##########
@@ -141,6 +133,24 @@ public void removeRootNodeTest() {
         assertThat(findRemoveRootNodeViaScope(expr("$data.getIndexes().getValues().get(0)"))).isEqualTo(new RemoveRootNodeResult(of(expr("$data")), expr("getIndexes().getValues().get(0)"), expr("getIndexes()")));
     }
 
+    @Test
+    public void test_transformDrlNameExprToNameExpr_maintainingMethodArgumentOrder(){
+        Expression e = expr("UtilsClass.utilityMethodWithLotsOfArguments($arg1, $arg2.field1, $arg3.field2, $arg4.field3, $arg5.field4))");

Review Comment:
   The test expression contains an extra closing parenthesis which could lead to unexpected parsing errors. Consider removing the extra closing parenthesis to ensure accurate evaluation of the method call.
   ```suggestion
           Expression e = expr("UtilsClass.utilityMethodWithLotsOfArguments($arg1, $arg2.field1, $arg3.field2, $arg4.field3, $arg5.field4)");
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#discussion_r2068193901


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/generator/DrlxParseUtilTest.java:
##########
@@ -141,6 +133,24 @@ public void removeRootNodeTest() {
         assertThat(findRemoveRootNodeViaScope(expr("$data.getIndexes().getValues().get(0)"))).isEqualTo(new RemoveRootNodeResult(of(expr("$data")), expr("getIndexes().getValues().get(0)"), expr("getIndexes()")));
     }
 
+    @Test
+    public void test_transformDrlNameExprToNameExpr_maintainingMethodArgumentOrder(){
+        Expression e = expr("UtilsClass.utilityMethodWithLotsOfArguments($arg1, $arg2.field1, $arg3.field2, $arg4.field3, $arg5.field4))");

Review Comment:
   @konB00yay @tkobayas Is this suggestion relevant?



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#discussion_r2068305374


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/generator/DrlxParseUtilTest.java:
##########
@@ -141,6 +133,24 @@ public void removeRootNodeTest() {
         assertThat(findRemoveRootNodeViaScope(expr("$data.getIndexes().getValues().get(0)"))).isEqualTo(new RemoveRootNodeResult(of(expr("$data")), expr("getIndexes().getValues().get(0)"), expr("getIndexes()")));
     }
 
+    @Test
+    public void test_transformDrlNameExprToNameExpr_maintainingMethodArgumentOrder(){
+        Expression e = expr("UtilsClass.utilityMethodWithLotsOfArguments($arg1, $arg2.field1, $arg3.field2, $arg4.field3, $arg5.field4))");

Review Comment:
   It's better to fix, but it doesn't affect the test. Btw, I'm considering a different way to fix. Please allow me some more time.



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco commented on PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#issuecomment-2841424462

   > @konB00yay Thank you! I'll get back to you soon.
   
   I'm also giving a look at this, at the moment I've the feeling that this is more fixing a symptom that the root cause, please give me some time to better debug the reproducer.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] Fixing issue #6323 preserving argument order [incubator-kie-drools]

Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco commented on PR #6324:
URL: https://github.com/apache/incubator-kie-drools/pull/6324#issuecomment-2846595383

   Fixed by https://github.com/apache/incubator-kie-drools/pull/6330


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org