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

Missing beta node sharing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 7.1.0.GA
    • Component/s: BRE
    • Labels:
      None
    • Target Release:
    • Fix Build:
      CR1

      Description

      The constraints of a beta node are reordered (based on their indexability) only when the node is attached to the rete network. This means that when a second not yet attached node is compared to the former one it is found not equal (and then not shared) because of the different constraints ordering as demonstrated by the following test case

          @Test
          public void testShareBetaWithConstraintReordering() {
              String str =
                      "import " + Person.class.getCanonicalName() + ";" +
                      "rule R1 when\n" +
                      "  $s : String()\n" +
                      "  $p : Person(name != $s, age == $s.length)\n" +
                      "then\n" +
                      "end\n" +
                      "rule R2 when\n" +
                      "  $s : String()\n" +
                      "  $p : Person(name != $s, age == $s.length)\n" +
                      "then\n" +
                      "end";
       
              KieSession ksession = getKieSession( str );
       
              assertEquals( 1, ReteDumper.collectNodes( ksession ).stream().filter( BetaNode.class::isInstance ).count() );
       
              EntryPointNode epn = (( InternalKnowledgeBase ) ksession.getKieBase()).getRete().getEntryPointNodes().values().iterator().next();
              ObjectTypeNode otn = epn.getObjectTypeNodes().get( new ClassObjectType( Person.class ) );
              assertEquals( 1, otn.getSinks().length );
          }
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  mfusco Mario Fusco
                  Tester:
                  Tibor Zimányi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: