Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1968

NPE on TupleSetsImpl.setNextTuple with SubnetworkTuple

XMLWordPrintable

    • False
    • None
    • False
    • CR1
    • +
    • 2023 Week 15-17 (from Apr 10), 2023 Week 18-20 (from May 1), 2023 Week 21-23 (from May 22), 2023 Week 24-26 (from Jun 12)

      Issue Description:

      This rule:

      rule Rule1
      when
        not String()
        List() from collect (Integer() from new Integer [] {1,2})
        Boolean() // always false
      then
      end
      
      rule Rule2
      when
        not String()
        List() from collect (Integer() from new Integer [] {1,2})
       then
        insert(new String());
      end
      

      fails with (just fireAllRules without inserting a fact)

      java.lang.NullPointerException
      	at org.drools.core.common.TupleSetsImpl.setNextTuple(TupleSetsImpl.java:349)
      	at org.drools.core.common.TupleSetsImpl.removeInsert(TupleSetsImpl.java:167)
      	at org.drools.core.phreak.RuleNetworkEvaluator.doRiaNode2(RuleNetworkEvaluator.java:705)
      	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
      	at org.drools.core.phreak.RuleNetworkEvaluator.doRiaNode(RuleNetworkEvaluator.java:631)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:554)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:386)
      	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:346)
      	at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:182)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:140)
      	at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:235)
      	at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:179)
      	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:110)
      	at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:33)
      	at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
      	at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:869)
      	at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:816)
      	at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:808)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1333)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1324)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1308)
      	at org.drools.compiler.integrationtests.SubnetworkTest.subnetworkSharingWith2SinksBeforeRia(SubnetworkTest.java:494)
      

      because in the rightTuples in the RIA node, the order of 2 SubnetworkTuple (stagedNext/stagedPrevious) was inverted while rightTuples.inserFirst is not changed. The inversion was caused by previous PhreakFromNode.doLeftDeletes.

      This issue happens only with non-exec-model, because exec-model happens not to share the FromNodes. (This may be another issue, but no harm)

      Acceptance Criteria:

      • Don't throw NPE. Just Rule2 is executed

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-abhumbe Abhijit Humbe
              Paolo Bizzarri Paolo Bizzarri
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: