Details
-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
8.37.0.Final
-
None
-
2023 Week 18-20 (from May 1)
-
-
Workaround Exists
-
-
NEW
-
NEW
-
---
-
---
Description
When using OOPath notation for rules some lines in the LHS require a variable binding even if the variable is not needed.
The following rule will throw an error
rule SmallDepositApprove when $l: /loanApplications[ applicant.age >= 20, deposit < 1000, amount <= 2000 ] /objects/objectB [value == "TEST"] then modify($l) { setApproved(true) }; end
The error:
Exception in thread "main" org.drools.model.codegen.project.RuleCodegenError: Errors were generated during the code-generation process: InvalidExpressionErrorResult: Unable to parse left part of expression: $l: /objects/objectB[ value == "TEST" ] at org.drools.model.codegen.project.DroolsModelBuilder.build(DroolsModelBuilder.java:129) at org.kie.kogito.codegen.rules.RuleCodegen.internalGenerate(RuleCodegen.java:113)