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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.6.0.GA
    • Fix Version/s: 7.7.0.GA
    • Component/s: BRE
    • Labels:

      Description

      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
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lucamolteni Luca Molteni
                  Reporter:
                  mputz Martin Weiler
                  Tester:
                  Daniel Rosa
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: