Uploaded image for project: 'JBoss BRMS Platform'
  1. JBoss BRMS Platform
  2. RHBRMS-1434

NOT conditional element is broken when used with subnetworks

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    Description

      In some cases, when a NOT node is the root of a subnetwork, the phreak segment having that node as root is not initialized as expected when the initial fact is inserted. That can prevent a rule to fire even if it should as demonstrated by the following test case.

      @Test
      public void testNestedNots()

      { String str = "package org.test; " + "rule negation_distributed_partially_no_sharing " + "when " + " (not String()) " + " and " + " (not (Double() and Integer())) " + "then " + " System.out.println(\"firing\"); " + "end"; KnowledgeBase kbase = loadKnowledgeBaseFromString(str); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); int n = ksession.fireAllRules(); assertEquals(1, n); }

      Note that if you invert the 2 NOTs putting the one with 2 conditions before the other the test succeeds.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mfusco@redhat.com Mario Fusco
            Archiver:
            rhn-support-ceverson Clark Everson
            Marek Winkler Marek Winkler (Inactive)
            Marek Winkler Marek Winkler (Inactive)
            Cheng Zhang (Inactive), etirelli, Marek Baluch, Rajesh Rajasekaran

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty