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

PropertyReactive with custom operator going in recursion on modify

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 7.17.0.Final
    • core engine
    • None
    • Hide

      1. Create Custom Operator using Evaluator and EvaluatorDefinition.
      2. Use this operator with a collection property (call it c2) of the object, in when condition, for both rules
      3. Use Modify in both rules for a different properties like a string variable or another collection property. (c3)
      4.Infinite updates take place

      5. Change custom operator to "contains" in both rules
      6. No more recursive updates

      Show
      1. Create Custom Operator using Evaluator and EvaluatorDefinition. 2. Use this operator with a collection property (call it c2) of the object, in when condition, for both rules 3. Use Modify in both rules for a different properties like a string variable or another collection property. (c3) 4.Infinite updates take place 5. Change custom operator to "contains" in both rules 6. No more recursive updates
    • NEW
    • NEW

      We have two rules each modifying separate properties but.

      As long as we are using PropertyReactive with builtin operators like contains, matches the updates are restricted. There is no infinite recursion.

      We have created a custom operator that checks the value in the when condition eg: when DClass( collectionSet matchesInSet "value")
      then modify $c( setDataPoint( "s" );

      This usage of custom operator is making rule execution go in infinite loop. Enabling drools trace we see: Fired rule Rule 1 Fired rule Rule 2 Fired rule Rule 1 Fired rule Rule 2..... infinitely.

      As PropertyReactive is working properly with collections (Contains works well - there is no recursion) this looks like some fix is required in rule engine.

              mfusco@redhat.com Mario Fusco
              shivanic shivani chandna (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: