Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1125

Executable model compilation fails with ClassCastException when using accumulate and additional constraint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.5.1.GA
    • 7.4.1.GA
    • BRE
    • 2019 Week 41-43 (from Okt 7)

      A rule containing the following constraint:

        when
        $customer : Customer( code == "RHT" )
        $max1 : Number() from accumulate(
          StockTick( company == $customer.code
          , $time : dueDate);
          max($time.getTime().getTime()))
      

      fails with a ClassCastException when building with the executable model:

      java.lang.ClassCastException: com.github.javaparser.ast.expr.NameExpr cannot be cast to com.github.javaparser.ast.expr.LambdaExpr
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitorPatternDSL.lambda$composeTwoBindings$4(AccumulateVisitorPatternDSL.java:67)
      	at java.util.Optional.ifPresent(Optional.java:159)
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitorPatternDSL.composeTwoBindings(AccumulateVisitorPatternDSL.java:64)
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitorPatternDSL.lambda$null$1(AccumulateVisitorPatternDSL.java:53)
      	at java.util.Optional.ifPresent(Optional.java:159)
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitorPatternDSL.lambda$processNewBinding$3(AccumulateVisitorPatternDSL.java:53)
      	at java.util.Optional.ifPresent(Optional.java:159)
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitorPatternDSL.processNewBinding(AccumulateVisitorPatternDSL.java:44)
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitor.classicAccumulate(AccumulateVisitor.java:129)
      	at org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitor.visit(AccumulateVisitor.java:107)
      	at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:122)
      	at org.drools.compiler.lang.descr.PatternDescr.accept(PatternDescr.java:272)
      	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:176)
      	at org.drools.modelcompiler.builder.generator.ModelGenerator.generateModel(ModelGenerator.java:156)
      	at org.drools.modelcompiler.builder.ModelBuilderImpl.compileKnowledgePackages(ModelBuilderImpl.java:176)
      	at org.drools.modelcompiler.builder.ModelBuilderImpl.buildRules(ModelBuilderImpl.java:121)
      	at org.drools.modelcompiler.builder.ModelBuilderImpl.buildPackages(ModelBuilderImpl.java:71)
      	at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:108)
      

              lmolteni@redhat.com Luca Molteni
              rhn-support-mputz Martin Weiler (Inactive)
              Tibor Zimányi Tibor Zimányi
              Tibor Zimányi Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: