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

NPE in RuntimeSegmentUtilies when accessing Datastore before query

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 8.41.0.Final
    • core engine
    • None
    • 2023 Week 30-32 (from Jul 24)
    • Hide

      Example project for reproducing the error can be found here: https://github.com/Elephantusparvus/ruleunit_tc

      Added source files and stack trace to attachments as well.

      Permanent github links to relevant sources:

      Fact class

      RuleUnitData implementation

      Test application 

      Drl file

      The drl file contains a few sets of working and not working versions of similar rules, which can be commented in and out.

      Show
      Example project for reproducing the error can be found here: https://github.com/Elephantusparvus/ruleunit_tc Added source files and stack trace to attachments as well. Permanent github links to relevant sources: Fact class RuleUnitData implementation Test application   Drl file The drl file contains a few sets of working and not working versions of similar rules, which can be commented in and out.
    • Compatibility/Configuration
    • NEW
    • NEW
    • ---
    • ---

    Description

      I implemented the backward chaining example from prior versions using rule units. Accessing a DataStore/Singletonstore in a rule before a query results in an NPE in RuntimSegmentUtilities.java:224 when trying to getObjectSinkPropagator because queryOtn is null. Stack trace can be found here README.
      The rule works like expected when only accessing "normal" globals, nothing at all or accessing Datastores after the query.

      Attachments

        1. Location.java
          2 kB
        2. Location-1.java
          2 kB
        3. locations_rules.drl
          2 kB
        4. LocationUnit.java
          0.9 kB
        5. stacktrace.txt
          2 kB
        6. TCTestApplication.java
          2 kB

        Activity

          People

            mfusco@redhat.com Mario Fusco
            lphnt Lennart Niecksch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: