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

NullPointerException when the 'result' block of an 'accumulate' function returns null

    XMLWordPrintable

    Details

      Description

      java.lang.NullPointerException
      at org.drools.common.DefaultFactHandle.<init>(DefaultFactHandle.java:73)
      at org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:34)
      at org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:57)
      at org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:48)
      at org.drools.reteoo.AccumulateNode.assertTuple(AccumulateNode.java:176)
      at org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
      at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:131)
      at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:20)
      at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:168)
      at org.drools.reteoo.Rete.assertObject(Rete.java:168)
      at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
      at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:163)
      at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1241)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:822)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:623)
      at com.sample.DroolsTest.main(DroolsTest.java:28)

      Example rule:
      rule "Example"
      no-loop true
      when
      $d: Double()
      from accumulate ( m : Message( $value: status ),
      init( double total = 0; ),
      action( System.out.println($value); ),
      result( null )
      )
      then
      System.out.println( "xx");

      end

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                agattik Alexandre Gattiker
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: