-
Bug
-
Resolution: Done
-
Major
-
None
-
7.24.0.Final
-
2019 Week 32-34
-
3
-
- See unit test PR
-
NEW
-
NEW
When a rule uses "matches" and class function and its argument is a property of the fact,
for example)
import org.drools.modelcompiler.domain.Person; import static org.drools.modelcompiler.domain.MyFunctions.*; rule R when $a : Person( name matches testMatch(likes) ) then end
It fails to build in executable-model
[ERROR] testMatchesClassFunctionWithArg[FLOW_DSL](org.drools.modelcompiler.CompilerTest) Time elapsed: 0.346 s <<< ERROR! java.lang.IllegalArgumentException: Cannot get expression type by name _this! at org.drools.modelcompiler.builder.generator.DrlxParseUtil.lambda$expressionTypeNameExpr$2(DrlxParseUtil.java:246) at java.util.Optional.orElseThrow(Optional.java:290) at org.drools.modelcompiler.builder.generator.DrlxParseUtil.expressionTypeNameExpr(DrlxParseUtil.java:246) at org.drools.modelcompiler.builder.generator.DrlxParseUtil.getExpressionType(DrlxParseUtil.java:180) at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.processFirstNode(ExpressionTyper.java:549)
It works with non-executable-model.
Additonal note: When running kie-maven-plugin with -DgenerateModel=YES in 7.23.0.Final-redhat-00002 (RHDM 7.4.0), the error message is "No value present".
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.23.0.Final-redhat-00002:generateModel (default-generateModel) on project model-map-evaluation-rule: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.23.0.Final-redhat-00002:generateModel failed: No value present -> [Help 1]
- is incorporated by
-
RHDM-1040 Executable-model build error with "matches" and fuction with a fact property as an argument
- Closed