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

Saliance is not working for 5.1.1 with fusion

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 5.3.0.Final
    • 5.1.1.FINAL
    • drools-core
    • None
    • Hide

      See attached files

      Show
      See attached files

      Using drools with time based rules and saliance, the saliance is not used when firing the rules

      This only happens when multiple objects update at the same time.

      e.g. Rule 1 is
      salience 1000
      dialect "mvel"
      when
      $i : Item(val==10)
      Item(val==11, this after [0s, 1m] $i)

      Rule 2 is
      salience 1000
      dialect "mvel"
      when
      $i : Item(val==10)
      not( Item(val==11, this after [0s,1m] $i))

      Rule3 is
      salience 100
      when
      $i : Item(val==11)

      Then we insert 3 items with val==10
      Rule2 is activated 3 times...
      Then we insert an item with val==11

      Note, with a val==10 and val==11 in the memory, Rule 1 will activate, and Rule 3 will activate
      However, Rule1 should fire first.. as its saliance is high

      For the first item it does, but then the Rule 3 fires before 2nd item does.

      Audit log is attached, but summary is

      Object inserted (1), Item: val==10
      Activation created: Rule 2 (1)
      Object inserted (2), Item: val==10
      Activation created: Rule 2 (2)
      Object inserted (3), Item: val==10
      Activation created: Rule 2 (3)
      Object inserted (4), Item: val==11
      Activation created: Rule 1 (1)
      Activation created: Rule 1 (2)
      Activation created: Rule 1 (3)
      Activation created: Rule 3 (4)
      Activation cancelled: Rule 2 (1)
      Activation cancelled: Rule 2 (2)
      Activation cancelled: Rule 2 (3)

      .. here we have 4 activations, 3 for Rule1 (saliance 1000), 1 for Rule3(saliance 100)
      Activation executed Rule 1 (1)
      Activation executed Rule 3 (4) //WRONG
      Activation cancelled: Rule 1 (2)
      Activation cancelled: Rule 1 (3)
      Activation created: Rule 2 (2)
      Activation created: Rule 2 (3)

      Note, this works fine in Drools 5.0
      In Drools 5.2.0 CR1 a null pointer is thrown (another issue will be logged for that)

        1. DroolsRuleTest.java
          4 kB
        2. Item.java
          0.8 kB
        3. rule1.drl
          0.7 kB

            etirelli@redhat.com Edson Tirelli
            richardambridge_jira Richard Ambridge (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Resolved:
              Archived: