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

Executable model compilation fails when binding a list from double square bracket

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.35.0.Final
    • core engine
    • None
    • 2020 Week 13-15 (from Mar 23)
    • Hide

      run

      mvn clean test
      

      on attached reproducer.

      Show
      run mvn clean test on attached reproducer.
    • NEW
    • NEW

    Description

      Executable model rule compilation fails when trying to bind a List from a double square bracket

      Example of DRL that fails to compile:

          rule "binding field indexed with square brackets"
          when $boundList: java.util.List() from [[1,2,3]]
               Pojo($boundList.containsAll(integerList))
          then
          end
      

      Error:

          com.github.javaparser.ParseProblemException: Encountered unexpected token: "[" "["
              at line 1, column 1.
          
          Was expecting one of:
          
              "!"
              "("
              "+"
              "++"
           ...
      

      The example works fine when compiling without executable model.

      We acknowledge that there are better and more efficient ways to achieve the same result as the above example, but there are perhaps other use-cases for the double square bracket mvel expression. As it is supported in DRL, should it be supported with executable model too?

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mcasalino Matteo Casalino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: