<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
That does sound like a problem, there should never be any behavioural
differences between the various performance configurations. We will fix
it for MR3. Could you open a JIRA for this please.<br>
<br>
Mark<br>
Shahad Ahmed wrote:
<blockquote
 cite="mid:1d2fdded0705171029k6b60023q18a246566d44305d@mail.gmail.com"
 type="cite">
  <div>&nbsp;</div>
  <div>I have a question about alpha node sharing in release 4.0MR2. In
the API for class&nbsp;RuleBaseConfiguration there is a method to turn alpha
node sharing on and off. However, I get some odd behaviour when I turn
it off and I was hoping someone can help me understand what's going on.
I'll illustrate the behaviour with the two rules "First" and Second"
defined below. Both rules work with&nbsp; a class Customer, which&nbsp;&nbsp;is a
simple object with attribute age. </div>
  <div>&nbsp;</div>
  <div>
  <div>rule "First"<br>
salience 10<br>
&nbsp;when<br>
&nbsp;&nbsp;c: Customer(age &lt;= 10)<br>
&nbsp;then<br>
&nbsp;&nbsp;System.out.println("First - Customer age less than 10");</div>
  <div>end</div>
  <div>&nbsp;</div>
  <div>rule&nbsp;"Second"<br>
salience 5<br>
&nbsp;when<br>
&nbsp;&nbsp;&nbsp;&nbsp; c: Customer(age &lt;= 10)<br>
&nbsp;then<br>
&nbsp;&nbsp;System.out.println("Second - Customer age less than 10");<br>
end<br>
&nbsp;</div>
  </div>
  <div>&nbsp;</div>
  <div>In the default case where alpha node sharing is on,&nbsp;I assert a
customer with age 5 and fireAllRules to get the following (hopefully,
correct) output:</div>
  <div>&nbsp;</div>
  <div>&nbsp; First - Customer age less than 10</div>
  <div>&nbsp; Second - Customer age less than 10</div>
  <div>&nbsp;</div>
  <div>However, if I set the setShareAlphaNodes(false) to turn off
alpha node sharing I get the following output:</div>
  <div>&nbsp;</div>
  <div>&nbsp; First - Customer age less than 10</div>
  <div>&nbsp;</div>
  <div>Reading the manual, I had assumed that the alpha node sharing
was just an optimization, and switching it off may be inefficient, but
would give the same output for the example rules. Is this correct, or
have I missunderstood alpha node sharing. 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. </div>
  <div>&nbsp;</div>
  <div>Regards</div>
  <div>Shahad<br>
&nbsp;</div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>