[jboss-jira] [JBoss JIRA] (DROOLS-5225) Constraint grouping fails with executable model
Mario Fusco (Jira)
issues at jboss.org
Tue Apr 7 09:51:29 EDT 2020
[ https://issues.redhat.com/browse/DROOLS-5225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14025269#comment-14025269 ]
Mario Fusco commented on DROOLS-5225:
-------------------------------------
I reproduced the problem and I'm working on it. For now I let you notice that the additional level of parenthesis is not necessary and indeed if you write
{code}
$p : Pojo(departuretimedayofweek == 1 || == 2 || == 7 )
{code}
also the executable model works as expected.
> Constraint grouping fails with executable model
> -----------------------------------------------
>
> Key: DROOLS-5225
> URL: https://issues.redhat.com/browse/DROOLS-5225
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.35.0.Final
> Reporter: Matteo Casalino
> Assignee: Mario Fusco
> Priority: Major
> Attachments: constraints-grouping.zip
>
>
> Executable model rule compilation fails when trying to build a pattern using constraint grouping.
> Example of DRL that fails to compile:
> {noformat}
> rule "TestBusiness"
> when $p : Pojo(departuretimedayofweek (== 1 || == 2 || == 7) )
> then
> end
> {noformat}
> Error:
> {noformat}
> java.lang.StackOverflowError
> at java.base/java.util.LinkedList.unlink(LinkedList.java:215)
> at java.base/java.util.LinkedList.remove(LinkedList.java:530)
> at com.github.javaparser.ast.Node.setParentNode(Node.java:389)
> at com.github.javaparser.ast.Node.setAsParentNodeOf(Node.java:403)
> at com.github.javaparser.ast.expr.BinaryExpr.setLeft(BinaryExpr.java:174)
> at com.github.javaparser.ast.expr.BinaryExpr.<init>(BinaryExpr.java:131)
> at com.github.javaparser.ast.expr.BinaryExpr.<init>(BinaryExpr.java:122)
> at org.drools.modelcompiler.builder.generator.DrlxParseUtil.trasformHalfBinaryToBinary(DrlxParseUtil.java:347)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:194)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:185)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:195)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:185)
> ...
> {noformat}
> The example works fine when compiling without executable model.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list