[jboss-jira] [JBoss JIRA] (DROOLS-5224) KieBase build fails with forall patterns containing "not equal" constraints on Dates
Mario Fusco (Jira)
issues at jboss.org
Tue Apr 7 04:42:00 EDT 2020
[ https://issues.redhat.com/browse/DROOLS-5224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-5224.
---------------------------------
Resolution: Done
Fixed by https://github.com/kiegroup/drools/commit/105f4300221de95e5650420f3f77087fc1077c79
> KieBase build fails with forall patterns containing "not equal" constraints on Dates
> ------------------------------------------------------------------------------------
>
> Key: DROOLS-5224
> URL: https://issues.redhat.com/browse/DROOLS-5224
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.33.0.Final, 7.34.0.Final, 7.35.0.Final
> Reporter: Matteo Casalino
> Assignee: Mario Fusco
> Priority: Major
> Attachments: forall-not-equal-constraint-on-dates.zip
>
>
> This is the same issue as https://issues.redhat.com/browse/DROOLS-5100, but on Dates.
> As of Drools 7.33.0.Final, forall patterns with "not equal" (!=) constraints on Dates will break when building the KieBase.
> For example the following DRL:
> {noformat}
> rule "forall with not equal"
> when forall(java.util.Date(this != "29-Dec-2019"))
> then
> end
> {noformat}
>
> generates the following error:
> {noformat}
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>
> at java.lang.String.substring(String.java:1967)
> at org.drools.core.rule.constraint.MvelConstraint.getLeftInExpression(MvelConstraint.java:608)
> at org.drools.core.rule.constraint.MvelConstraint.hashCode(MvelConstraint.java:602)
> at org.drools.core.reteoo.AlphaNode.calculateHashCode(AlphaNode.java:189)
> at org.drools.core.reteoo.AlphaNode.<init>(AlphaNode.java:89)
> at org.drools.core.reteoo.builder.PhreakNodeFactory.buildAlphaNode(PhreakNodeFactory.java:88)
> at org.drools.core.reteoo.builder.PatternBuilder.buildAlphaNodeChain(PatternBuilder.java:360)
> at org.drools.core.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:346)
> at org.drools.core.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:136)
> at org.drools.core.reteoo.builder.PatternBuilder.build(PatternBuilder.java:84)
> at org.drools.core.reteoo.builder.GroupElementBuilder$NotBuilder.build(GroupElementBuilder.java:220)
> at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
> at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:108)
> at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
> at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:167)
> at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:139)
> at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110)
> at org.drools.core.impl.KnowledgeBaseImpl.internalAddRule(KnowledgeBaseImpl.java:1525)
> at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:926)
> at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:728)
> at org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:745)
> at org.drools.core.impl.KnowledgeBaseImpl.addPackages(KnowledgeBaseImpl.java:728)
> at org.drools.compiler.kie.builder.impl.AbstractKieModule.createKieBase(AbstractKieModule.java:226)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:407)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:375)
> {noformat}
> This is working fine when using Drools <= 7.32.0.Final.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list