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

NullPointerException with executable model using accumulate max with null Date field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.7.0.GA
    • 7.6.0.GA
    • BRE
    • 2020 Week 04-06 (from Jan 20)

      Executing a rule containing accumulate max, eg:

      rule AccumulateMaxDate
        when
        $max1 : Number() from accumulate(
        StockTick(isSetDueDate == true
              ,$time : dueDate);
             max($time.getTime().getTime()))
        then
        end
      

      fails with a NPE at runtime if the StockDate.dueDate field is null:

      Caused by: java.lang.NullPointerException
      	at defaultpkg.RulesA0DFC3D10EA29F3818B87E11918D8020RuleMethods0.lambda$rule_AccumulateMaxDate$c9e019d8$1(RulesA0DFC3D10EA29F3818B87E11918D8020RuleMethods0.java:34)
      	at org.drools.model.functions.Function1$Impl.apply(Function1.java:35)
      	at org.drools.model.view.BindViewItem1.eval(BindViewItem1.java:85)
      	at org.drools.modelcompiler.constraints.BindingEvaluator.evaluate(BindingEvaluator.java:39)
      	at org.drools.modelcompiler.constraints.BindingEvaluator.evaluate(BindingEvaluator.java:35)
      	at org.drools.modelcompiler.constraints.LambdaAccumulator$BindingAcc.getAccumulatedObject(LambdaAccumulator.java:154)
      	at org.drools.modelcompiler.constraints.LambdaAccumulator.accumulate(LambdaAccumulator.java:88)
      	at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:97)
      	... 53 more
      

              lmolteni@redhat.com Luca Molteni
              rhn-support-mputz Martin Weiler (Inactive)
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: