Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2931

Regression: unqualified type in strict mode error

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 5.2.0.M1
    • None

      This (stupid) rule:

      rule "Testing contains"
        dialect "mvel"
        when
          Response( $answerSelections : answerSelections )
          AnswerSelection( answer.ID in (2, 3) )
      #    AnswerSelection( answer.ID == 2 || == 3 )
      #    AnswerSelection( answer.ID == 2 || answer.ID == 3 )
        then
          System.out.println("Testing contains activated")
      end
      

      ...produces this error message:

      Unable to Analyse Expression answer.ID == 2 || answer.ID == 3:
      [Error: Failed to compile: 1 compilation error(s): 
       - (1,9) unqualified type in strict mode for: ID]
      [Near : {... Unknown ....}]
                   ^
      [Line: 1, Column: 0] : [Rule name='Testing contains']
      

      Response has a getAnswerSelections() method that returns a Collection type. AnswerSelection has a getAnswer() method that returns an Answer. Answer has a getID() method that returns an int.

      This rule compiled fine under Drools 5.1.1 and 5.2.0.M1 and fails under 5.2.0-SNAPSHOT.

            mproctor@redhat.com Mark Proctor
            ljnelson+github@gmail.com Laird Nelson
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Resolved:
              Archived: