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

Variable on left of matches operator causes 'unable to resolve method' error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.0.CR2
    • 6.2.0.Final
    • core engine
    • None
    • NEW
    • NEW

      Using a variable on the left of 'matches' fails in 6.2.0.FInal, when it worked in 6.1.0.Final. E.g.

      when
      Fact( $field : field )
      RegEx( $field matches pattern )

      results in
      [Error: unable to resolve method: defaultpkg.RegEx.$field() [arglength=0]]
      [Near :

      {... $field ~= pattern ....}

      ]

      This can be worked around for the positive case by simply moving the constraint, e.g.

      when
      RegEx( $pattern : pattern )
      Fact( field matches $pattern )

      But it makes it impossible to find facts that are not matched by any regex, e.g.

      when
      Fact( $field : field )
      not RegEx( $field matches pattern )

            mfusco@redhat.com Mario Fusco
            andrew.bickerton_jira Andrew Bickerton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: