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

NPE when building KieBase with OOPath in a declared window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.Beta7
    • 7.0.0.Beta6
    • core engine
    • Hide

      Please run the tests org.drools.testcoverage.functional.oopath.OOPathCepTest for declared windows (does not matter if time or length) from PR [1].

      [1] https://github.com/droolsjbpm/drools/pull/1117

      Show
      Please run the tests org.drools.testcoverage.functional.oopath.OOPathCepTest for declared windows (does not matter if time or length) from PR [1]. [1] https://github.com/droolsjbpm/drools/pull/1117
    • NEW
    • NEW

      When using an OOPath expression in a declared window (does not matter if a length or a time window), a NPE is thrown. For instance, a rule such as:

      declare window Pings
        MessageEvent( /msg{ message == 'Ping' } ) over window:length( 2 )
      end
      
      rule R when
        $messageEvent: MessageEvent() from window Pings
      then
        events.add( $messageEvent );
      end
      

      produces the following exception (see the attachment for the full stacktrace) when building the KieBase:

      java.lang.NullPointerException
      	at org.drools.core.reteoo.builder.WindowReferenceBuilder.build(WindowReferenceBuilder.java:40)
      	at org.drools.core.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:116)
      	at org.drools.core.reteoo.builder.PatternBuilder.build(PatternBuilder.java:77)
      	at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:108)
      	at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
      	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:164)
      	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:136)
      	at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110)
      ...
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:630)
      ...
      

              mfusco@redhat.com Mario Fusco
              mwinkler@redhat.com Marek Winkler (Inactive)
              Marek Winkler Marek Winkler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: