]
Toshiya Kobayashi updated DROOLS-4382:
--------------------------------------
Git Pull Request:
Executable-model build error with "matches" and fuction
with a fact property as an argument
-------------------------------------------------------------------------------------------
Key: DROOLS-4382
URL:
https://issues.jboss.org/browse/DROOLS-4382
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.24.0.Final
Reporter: Toshiya Kobayashi
Assignee: Luca Molteni
Priority: Major
Labels: support
When a rule uses "matches" and class function and its argument is a property of
the fact,
for example)
{noformat}
import org.drools.modelcompiler.domain.Person;
import static org.drools.modelcompiler.domain.MyFunctions.*;
rule R when
$a : Person( name matches testMatch(likes) )
then
end
{noformat}
It fails to build in executable-model
{noformat}
[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)
{noformat}
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".
{noformat}
[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]
{noformat}