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

Binding on method call with params and comparison in the same constraint fails parsing in executable model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • 2021 Week 28-30 (from Jul 12)
    • Hide

      I have a minimal example and tests here:

      https://github.com/fbraun4358/drools-executable-binding-bug

      Show
      I have a minimal example and tests here: https://github.com/fbraun4358/drools-executable-binding-bug
    • Undefined
    • NEW
    • NEW

      The executable model will break when parsing a rule like below where there is a method call with an argument and binding and comparison happening at the same time. The old model will have this work. If the method call has no arguments then this works as well.

      rule "Rule that breaks ExecutableModel"
      @filename("rules.drl")
      ruleflow-group "RFG-1"
      salience 5
          when
              $values: List()
              $cwv:    ClassWithValue( $value: value.charAt(5) == '5' )
          then
              $values.add($value);
      end

      The executable model will have this work when the binding and comparison are multiple constraints like so:

      package com.example.rulesimport java.util.*import com.example.*rule "Rule that breaks ExecutableModel"
      @filename("rules.drl")
      ruleflow-group "RFG-1"
      salience 5
          when
              $values: List()
              $cwv:    ClassWithValue( $value: value.charAt(5), $value == '5' )
          then
              $values.add($value);
      end
      

              mfusco@redhat.com Mario Fusco
              fbraun4358 Florian Braun (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: