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

alphanetwork-compiler : failed to evaluate chained alpha node

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • core engine
    • None
    • 2022 Week 35-37 (from Aug 29)
    • 2
    • NEW
    • NEW
    • ---
    • ---

      Drools 8.26.0.Beta

      rule r1 when
        $p : Person( name == "Luca", likes == "food")
      then
        results.add($p);
      end
      rule r2 when
        $p : Person( name == "Luca", likes == "videogames")
      then
        results.add($p);
      end
      rule r3 when
        $p : Person( name == "Luca", likes == "music")
      then
        results.add($p);
      end
      

      The first condition name == "Luca" is not effective ("Mario" passes). This issue only happens when the second condition has more than 3 variations (= AlphaNode hash-indexed).

      See that " if (mVELConstraint4.isAllowed(handle, wm)) { } " does nothing in the generated code.

      public final void propagateAssertObject(org.drools.core.common.InternalFactHandle handle, org.drools.core.common.PropagationContext context, org.drools.core.common.ReteEvaluator wm) {
          if (logger.isDebugEnabled()) {
              logger.debug("propagateAssertObject on compiled alpha network {} {} {}", handle, context, wm);
          }
          org.drools.ancompiler.Person fact = (org.drools.ancompiler.Person) handle.getObject();
          if (mVELConstraint4.isAllowed(handle, wm)) {
          }
          java.lang.String switchVar = (java.lang.String) readAccessor.getValue(fact);
          if (switchVar != null)
              switch(switchVar) {
                  case "music":
                      extractedPropagated_2CAF6357FABCEA1AEBA4E47B9C398F0D_0(handle, context, wm);
                      break;
                  case "videogames":
                      extractedPropagated_2CAF6357FABCEA1AEBA4E47B9C398F0D_1(handle, context, wm);
                      break;
                  case "food":
                      extractedPropagated_2CAF6357FABCEA1AEBA4E47B9C398F0D_2(handle, context, wm);
                      break;
              }
      }
      

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: