[jboss-jira] [JBoss JIRA] Created: (JBRULES-859) Switching off alpha node sharing changes rule behaviour

Shahad Ahmed (JIRA) jira-events at lists.jboss.org
Fri May 18 05:00:52 EDT 2007


Switching off alpha node sharing changes rule behaviour
-------------------------------------------------------

                 Key: JBRULES-859
                 URL: http://jira.jboss.com/jira/browse/JBRULES-859
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Reteoo
    Affects Versions: 4.0.0.MR2
         Environment: Windows XP SP2, Intel x86 Pentium 4  3.0MHz, 1Gb RAM
            Reporter: Shahad Ahmed
         Assigned To: Mark Proctor


In release 4.0MR2, switching off alpha node sharing appears to change the results produced by a set of rules.  I'll illustrate the behaviour with the two rules "First" and Second" defined below. Both rules work with a class Customer, which is a simple object with an attribute age. 
 
rule "First"
salience 10
 when
  c: Customer(age <= 10)
 then
  System.out.println("First - Customer age less than 10");
end
 
rule "Second"
salience 5
 when
     c: Customer(age <= 10)
 then
  System.out.println("Second - Customer age less than 10");
end
 
 
For the default case where alpha node sharing is on, I assert a customer with age 5 and fireAllRules to get the following (hopefully, correct) output:
 
  First - Customer age less than 10
  Second - Customer age less than 10
 
However, if I call setShareAlphaNodes(false) in RuleBaseConfiguration to turn off alpha node sharing I get the following output:
 
  First - Customer age less than 10
 
Alpha node sharing is an optimization and switching it on or off should give the same output for a set of  rules. I've tried switching off alpha node sharing both directly via the API method, and using the system property option, but the behaviour is the same in both cases. 

Shahad

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list