Bug 1072462
| Summary: | NOT conditional element is broken when used with subnetworks | ||
|---|---|---|---|
| Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Mario Fusco <mfusco> |
| Component: | BRE | Assignee: | Mario Fusco <mfusco> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Marek Winkler <mwinkler> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.0.0 | CC: | etirelli, mbaluch, rrajasek, rzhang |
| Target Milestone: | ER2 | ||
| Target Release: | 6.0.1 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-08-06 19:58:47 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
This was cherry-picked into the 6.0.1.ER2 tag: https://github.com/jboss-integration/drools/commit/db551f6 Mario Fusco <mario.fusco> updated the status of jira DROOLS-444 to Resolved Verified that the fix is present in BRMS 6.0.1 ER2 and the relevant tests pass. |
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.