You can &#39;disable&#39; this by *explicitly* specifying not to assign the same object like this:<div><span class="Apple-style-span" style="border-collapse: collapse; ">$n : new_item : Item( exId : externalId )<br>old_item : Item( this != $n, externalId == exId )</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">this relies on equals/hashCode method, if you need to use object identities:</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;">$n : new_item : Item( exId : externalId )<br>$o : old_item : Item( eval($o != $n), externalId == exId )<br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span><br><div class="gmail_quote">On Thu, Nov 13, 2008 at 3:19 AM, Knych, Thomas <span dir="ltr">&lt;<a href="mailto:thomas.knych@citi.com">thomas.knych@citi.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi -<br>
<br>
I&#39;m upgrading a large base of rules from 3.x to <a href="http://4.0.7." target="_blank">4.0.7.</a> However there<br>
seem to be a few semantic differences. I have rules like the below in a<br>
few places:<br>
<br>
rule &quot;All items should have a unique external id&quot;<br>
 &nbsp; &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;new_item : Item( exId : externalId )<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;old_item : Item( externalId == exId )<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LOG.warn( &quot;DUPE Detected: new:&quot; + &nbsp;new_item + &quot; old:&quot; +<br>
old_item );<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retract( new_item );<br>
end<br>
<br>
And this all worked fine because 3.x would never assign the same object<br>
to both new_item and old_item. I know my new/old seem arbitary - but I&#39;m<br>
just getting down to the minimal reproducing case. 4.x now will assign<br>
one instance of an object to both new_item and old_item. Is there any<br>
way to disable this behaviour?<br>
<br>
<br>
thanks,<br>
-Tom<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br></div>