]
Mario Fusco reassigned DROOLS-3558:
-----------------------------------
Assignee: Mario Fusco (was: Luca Molteni)
"NoSuchElementException: No value present" with
executable-model, Map and binding
---------------------------------------------------------------------------------
Key: DROOLS-3558
URL:
https://issues.jboss.org/browse/DROOLS-3558
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.16.0.Final
Reporter: Toshiya Kobayashi
Assignee: Mario Fusco
Priority: Major
Labels: support
When compiling a below rule with executable-model:
{noformat}
rule R1
when
$p : Person()
$a : Address(number == $p.items[1])
then
end
{noformat}
it fails with the following error:
{noformat}
[ERROR] Tests run: 165, Failures: 0, Errors: 2, Skipped: 3, Time elapsed: 20.794 s
<<< FAILURE! - in org.drools.modelcompiler.CompilerTest
[ERROR] testMapWithBinding[FLOW_DSL](org.drools.modelcompiler.CompilerTest) Time
elapsed: 0.02 s <<< ERROR!
java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135)
at
org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionFromMethodCallOrField(ExpressionTyper.java:397)
at
org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:211)
at
org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpression(ExpressionTyper.java:108)
at
org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.parseBinaryExpr(ConstraintParser.java:295)
at
org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.getDrlxParseResult(ConstraintParser.java:111)
at
org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:78)
at
org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint(PatternDSL.java:124)
at
org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern(PatternDSL.java:191)
at
org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:128)
at org.drools.compiler.lang.descr.PatternDescr.accept(PatternDescr.java:267)
at
org.drools.modelcompiler.builder.generator.visitor.AndVisitor.visit(AndVisitor.java:29)
at
org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:69)
at
org.drools.modelcompiler.builder.generator.ModelGenerator.processRule(ModelGenerator.java:174)
at
org.drools.modelcompiler.builder.generator.ModelGenerator.generateModel(ModelGenerator.java:154)
at
org.drools.modelcompiler.builder.ModelBuilderImpl.compileKnowledgePackages(ModelBuilderImpl.java:144)
at
org.drools.modelcompiler.builder.ModelBuilderImpl.buildRules(ModelBuilderImpl.java:94)
at
org.drools.modelcompiler.builder.ModelBuilderImpl.buildPackages(ModelBuilderImpl.java:63)
at
org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:108)
at
org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:100)
at
org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:257)
at
org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:74)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:267)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:235)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:204)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:192)
at org.drools.modelcompiler.BaseModelTest.createKieBuilder(BaseModelTest.java:142)
at org.drools.modelcompiler.BaseModelTest.createKieBuilder(BaseModelTest.java:125)
at org.drools.modelcompiler.BaseModelTest.getKieContainer(BaseModelTest.java:114)
at org.drools.modelcompiler.BaseModelTest.getKieContainer(BaseModelTest.java:107)
at org.drools.modelcompiler.BaseModelTest.getKieSession(BaseModelTest.java:103)
at org.drools.modelcompiler.BaseModelTest.getKieSession(BaseModelTest.java:99)
at org.drools.modelcompiler.CompilerTest.testMapWithBinding(CompilerTest.java:1457)
...
{noformat}