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

executable-model doesn't provide line number of DRL parse error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.47.0.Final
    • 7.46.0.Final
    • executable model
    • None
    • 2020 Week 46-48 (from Nov 9)
    • 4
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

      ParseExpressionErrorResult.getLines() (and other error results classes other than CompilationProblemErrorResult) returns an empty array. So error message tells that the error line is -1. (e.g. JBRULESTest.testJBRULES2872())

      Message [id=1, kieBase=defaultKieBase, level=ERROR, path=rules1.drl, line=-1, column=0
         text=Unable to Analyse Expression enumVal == TestEnum.ONE || enumVal == TestEnum.TWO:]
      

      https://github.com/kiegroup/drools/blob/master/drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/builder/errors/ParseExpressionErrorResult.java#L44-L46

      Looking at PatternDSL.findAllConstraint(), BaseDescr (constraint) retains its line number but ConstraintExpression (constraintExpression) doesn't. So we cannot find the line number inside
      ConstraintParser.drlxParse().

      https://github.com/kiegroup/drools/blob/master/drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/builder/generator/visitor/pattern/PatternDSL.java#L134-L136

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

                Created:
                Updated:
                Resolved: