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

executable-model fails with "from" and ternary expression

    XMLWordPrintable

Details

    Description

      Issue Description:

      This rule fails with exec-model while works with non-exec-model.

      rule R
        when
          $foo: Number()
          $bar: Boolean() from ($foo > 0 ? true : false)
        then
      end
      
      java.lang.UnsupportedOperationException
      	at org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:386)
      	at org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.toTypedExpression(ExpressionTyper.java:161)
      	at org.drools.model.codegen.execmodel.generator.drlxparse.ConstraintParser.compileToJavaRecursive(ConstraintParser.java:292)
      	at org.drools.model.codegen.execmodel.generator.drlxparse.ConstraintParser.compileStart(ConstraintParser.java:200)
      	at org.drools.model.codegen.execmodel.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:150)
      	at org.drools.model.codegen.execmodel.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:142)
      	at org.drools.model.codegen.execmodel.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:138)
      	at org.drools.model.codegen.execmodel.generator.visitor.FromVisitor.createArg(FromVisitor.java:282)
      	at org.drools.model.codegen.execmodel.generator.visitor.FromVisitor.addLambdaToFromExpression(FromVisitor.java:264)
      	at org.drools.model.codegen.execmodel.generator.visitor.FromVisitor.fromExpressionUsingArguments(FromVisitor.java:199)
      	at org.drools.model.codegen.execmodel.generator.visitor.FromVisitor.lambda$1(FromVisitor.java:140)
      ...
      

      Acceptance Criteria:

      This rule should work with exec-model.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: