Hi everyone,<br>I am new to this mailing list, I&#39;ve had a quick look at archives and didn&#39;t find anything ont this subject but sorry if this has allready been underlined.<br><br>Here is my problem, while I was doing some test on 
v3.0.6, 4.0.0 came out, so I started to migrate on the new version. Then I found out an unexpecteed behavior on the 4.0.0.<br><br>I have been compiling both with Java 5 and running whith Java 1.5.0_11. And I used versions with dependencies on both tests.
<br><br>I have made an exemple for you to make it as clear as possible, here is the rule :<br><br>---------------------------------------------------------------------------------------<br>package rules<br><br>rule &quot;TwoCheeses&quot;
<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $cheese1 : Cheese();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $cheese2 : Cheese();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; then <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println($cheese1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println($cheese2);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(&quot;TwoCheeses&quot;);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
<br>end<br>---------------------------------------------------------------------------------------<br><br>When I run it on V3.0.6, with this code :<br><br>---------------------------------------------------------------------------------------
<br>package rules;<br><br>import java.io.InputStreamReader;<br><br>import org.drools.RuleBase;<br>import org.drools.RuleBaseFactory;<br>import org.drools.WorkingMemory;<br>import org.drools.compiler.PackageBuilder;<br><br>
public class Cheese {<br>&nbsp;&nbsp;&nbsp; public static void main(String[] args) throws Exception{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PackageBuilder builder = new PackageBuilder();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; builder.addPackageFromDrl(new InputStreamReader(Cheese.class.getResourceAsStream
(&quot;rule.drl&quot;)));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RuleBase ruleBase = RuleBaseFactory.newRuleBase();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ruleBase.addPackage(builder.getPackage());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WorkingMemory workingMemory = ruleBase.newWorkingMemory
();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Cheese cheese = new Cheese();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; workingMemory.assertObject(cheese);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; workingMemory.fireAllRules();<br>&nbsp;&nbsp;&nbsp; }<br>}<br>---------------------------------------------------------------------------------------
<br><br>The rule doesn&#39;t fire, which is normal AMHA since only one Cheese object is asserted to the WM<br><br>When I run it on V4.0.0, whith this code :<br>---------------------------------------------------------------------------------------
<br>package rules;<br><br>import java.io.InputStreamReader;<br><br>import org.drools.RuleBase;<br>import org.drools.RuleBaseFactory;<br>import org.drools.StatefulSession;<br>import org.drools.compiler.PackageBuilder;<br><br>
public class Cheese {<br>&nbsp;&nbsp;&nbsp; public static void main(String[] args) throws Exception{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PackageBuilder builder = new PackageBuilder();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; builder.addPackageFromDrl(new InputStreamReader(Cheese.class.getResourceAsStream
(&quot;rule.drl&quot;)));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RuleBase ruleBase = RuleBaseFactory.newRuleBase();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ruleBase.addPackage(builder.getPackage());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; StatefulSession statefulSession = 
ruleBase.newStatefulSession(); <br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Cheese cheese = new Cheese();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; statefulSession.assertObject(cheese);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; statefulSession.fireAllRules();<br>&nbsp;&nbsp;&nbsp; }<br>}<br>---------------------------------------------------------------------------------------
<br>Now the rule fires and $cheese1 $cheese2 have the same reference.<br><br>I have been searching in all docs, this modification of behavior doesn&#39;t seem to be expected, has anyone noticed this?<br><br>Thanks for your help.
<br><br>Chris<br><br><br>