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

PhreakAccumulateNode will trigger "accctx" NullPointerException when fireAll Rules for some cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 7.74.1.Final, 8.44.0.Final
    • core engine, dmn engine
    • None
    • Hide

      1.To reproduce, run the use case tests in attached projects of the ticket, then see the error message.

      The "accctx"NullPointerException happened in Drools 8.44.Final.

       

      Note: the test will report "tuple" is null exception if the test run in Drools version before 7.74.1.Final, like 7.73.0.Final.
       
       

      java.lang.NullPointerException: Cannot invoke "org.drools.core.reteoo.AccumulateNode$BaseAccumulation.setPropagationContext(org.drools.core.common.PropagationContext)" because "accctx" is null   at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:728) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdatesProcessChildren(PhreakAccumulateNode.java:486) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdates(PhreakAccumulateNode.java:445) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:74) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:595) ..........
       
      

       

      usecaseOfDrools8.zip

      Show
      1.To reproduce, run the use case tests in attached projects of the ticket, then see the error message. The "accctx"NullPointerException happened in Drools 8.44.Final.   Note: the test will report "tuple" is null exception if the test run in Drools version before 7.74.1.Final, like 7.73.0.Final.     java.lang.NullPointerException: Cannot invoke "org.drools.core.reteoo.AccumulateNode$BaseAccumulation.setPropagationContext(org.drools.core.common.PropagationContext)" because "accctx" is null   at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:728) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdatesProcessChildren(PhreakAccumulateNode.java:486) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdates(PhreakAccumulateNode.java:445) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:74) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:595) ..........     usecaseOfDrools8.zip
    • NEW
    • NEW
    • ---
    • ---

      The test cases come from our business scenarios,
      More descriptions about the DRL file in case:
      In digital commerce, we implement one rule as followings business purpose :

      If customers buy some products in cart, we will give the qualified products some discount and consume the left-quantity of the qualified products until the left-quantity to be 0.

      1. We allow the rule to be executed more than one time, so the "no-loop" to be false.
      2. For the when parts of the Drl, we add the check to test whether the products (that has left-quantity>0) exists in cart.
      3.Also we add the "filter" parts in accumulate to filter the qualified(belong the "575" category) products , and the qualified products will be passed into action part of the DRL,  and  qualified products can be consumed by reducing the left-quantity and generate discount actions as code shows. 

              mfusco@redhat.com Mario Fusco
              criswork cris li (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: