Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4376

Abbreviated comparison with Map fails in executable-model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.24.0.Final
    • executable model

      When we write abbreviated comparison with Map,

      import java.util.Map;
      rule R1 when
          Map(this['money'] >= 65 && <= 75)
      then
      end
      

      executable-model build fails.

      [ERROR] testMapAbbreviatedComparison[FLOW_DSL](org.drools.modelcompiler.CompilerTest)  Time elapsed: 0.258 s  <<< ERROR!
      java.lang.UnsupportedOperationException: Unknown expression: this["money"]
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.findLeftLeafOfNameExpr(ExpressionTyper.java:875)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.findLeftLeafOfNameExpr(ExpressionTyper.java:867)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.findLeftLeafOfNameExpr(ExpressionTyper.java:867)
      	at org.drools.modelcompiler.builder.generator.DrlxParseUtil.trasformHalfBinaryToBinary(DrlxParseUtil.java:331)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:170)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpression(ExpressionTyper.java:118)
      	at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.parseBinaryExpr(ConstraintParser.java:309)
      	at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.getDrlxParseResult(ConstraintParser.java:114)
      	at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:81)
      	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)
      

              lmolteni@redhat.com Luca Molteni
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: