Not quite.<br><br>It&#39;s really the opposite.&nbsp; There is a change I want the engine to see now, but my own code has not propagated the real change back around to the rule engine just yet.&nbsp; If I don&#39;t use my own proxy to hold the new value, then other rules will fire that I don&#39;t want.&nbsp; If I use my proxy, I manipulate the value and keep the other rules from firing.&nbsp; Once the &quot;real&quot; change comes back around, my own proxy stops &quot;overriding&quot; the value and the rules engine never even sees the real change to the underlying object.
<br><br>-Chris West<br><br><div><span class="gmail_quote">On 7/17/07, <b class="gmail_sendername">Edson Tirelli</b> &lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&nbsp;&nbsp; Chris,<br><br>&nbsp;&nbsp; I&#39;m not sure I understood your scenario bellow, but it does seem exactly what shadow facts do: a lazy proxy.<br>&nbsp;&nbsp; In other words, lets say you have an object X. You assert X into working memory and the engine creates a shadow proxy for it. Then, you can mess with it as much as you want from outside the engine, changing its property values and etc... all that will be &quot;invisible&quot; to the engine, until you call an update on X. At this point, the engine will start seeing the current &quot;snapshot&quot; of the object properties...
<br><br>&nbsp;&nbsp; So, my question, isn&#39;t that what you are doing with your own proxy?<div><span class="e" id="q_113d52f815640af5_1"><br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/7/17, Chris West &lt;
<a href="mailto:crayzfishr@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">crayzfishr@gmail.com
</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thank you for your response to this issue.<br><br>My use case for using proxies is this:
<br><br>The facts are not modifiable directly (no setter methods) or synchronously.&nbsp; Modifications to facts occur by calling another method which modifies the fact and notifies the rules engine of the modification asynchronously outside of the call stack (but in the same thread) that triggered the change to begin with.&nbsp; To give the appearance of a modification until the real notification comes asynchronously, I wrap these objects with proxies, and the proxy provides the ability to &quot;override&quot; a property until the real notification comes in later in a different call stack.&nbsp; The reason for the modifications occurring in this fashion is driven by the fact that this is a discrete event simulation, and changes to the system occur only as events which are queued to execute in priority order.&nbsp; The modifications to facts are just queued events just like everything else.
<br><span><br>-Chris </span><div><span><br><br><div><span class="gmail_quote">On 7/17/07, <b class="gmail_sendername">Edson Tirelli</b> &lt;<a href="mailto:tirelli@post.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

tirelli@post.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&nbsp;&nbsp; Chris,<br><br>&nbsp;&nbsp; Unfortunately, that is true. Shadow facts exist to ensure the rules engine integrity. At this point, there is no alternative to shadow facts, because the solution we used in 3.x had too many drawbacks and did not scaled for complex rules.
<br><br>&nbsp;&nbsp; We are trying to come up with an alternative strategy compatible with current architecture, but it will not make 4.0 final because we are in feature freeze for the release. It will eventually come out in a maintenance or minor release. 
<br><br>&nbsp;&nbsp; Can you present us your use case for asserting JDK proxies as facts?<br><br>&nbsp;&nbsp; Thanks,<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br>&nbsp;&nbsp; <br><br><div><span class="gmail_quote">2007/7/17, Chris West &lt;<a href="mailto:crayzfishr@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">



crayzfishr@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span>Hello,<br>
<br>With prior versions of JBoss Rules (3.0.5) I have been using JDK generated dynamic proxies as facts, and they have been working fine.&nbsp; However, after upgrading to JBoss Rules 
4.0.0MR3, I cannot seem to get the dynamic proxies to work as facts.&nbsp; It seems that even though a rule fires that changes a field on the proxy, a second rule that should not be activated after the update still fires.
<br><br>According to the JDK javadoc documentation, dynamic proxies are created as final.&nbsp; My assumption is that JBoss Rules is not creating Shadow facts for these since they are final.&nbsp; After reading the JIRA at <a href="http://jira.jboss.com/jira/browse/JBRULES-960" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">




http://jira.jboss.com/jira/browse/JBRULES-960</a>, I now am questioning what the effect of not using shadow facts is on the engine.&nbsp; The relevant part of that is:<br><br>&quot;The problem is that SpringAOP is generating a proxy whose methods
equals() and hashCode() are &quot;final&quot;. As drools must either override
these methods in the shadow proxy or not shadow the fact at all, I&#39;m
disabling shadow proxy generation for this use case.
<br><div>
It is really important to note that if you are asserting SpringAOP
proxies as facts into the working memory, you will not be able to
change any field value whose field is constrained in rules or you may
incur in a memory leak and non-deterministic behavior by the rules
engine. Unfortunately there is nothing we can do about, since when
SpringAOP makes the methods equals and hashcode final, we can&#39;t
override them anymore and as so, we can&#39;t shadow them.&quot;<br>

    

</div>




<div>
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div>
    [ <a href="http://jira.jboss.com/jira/browse/JBRULES-960" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Show »</a> ]
    </div>
    <div style="overflow: hidden;">
        <a name="113d52f815640af5_113d523e7c828823_113d508e08cdd121_113d4f63da2d6c02_action_12367491">
                                                        
                        
            </a><a href="http://jira.jboss.com/jira/secure/ViewProfile.jspa?name=tirelli" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Edson Tirelli</a> <font size="-2">[<span>02/Jul/07 03:29 PM
</span>]</font>
The problem is that SpringAOP is generating a proxy whose methods
equals() and hashCode() are &quot;final&quot;. As drools must either override
these methods in the shadow proxy or not shadow the fact at all, I&#39;m
disabling shadow proxy generation for this use case.
It is really important to note that if you are asserting SpringAOP
proxies as facts into the working memory, you will not be able to
change any field value whose field is constrained in rules or you may
incur in a memory leak and non-deterministic behavior by the rules
engine. Unfortunately there is nothing we can do about, since when
SpringAOP makes the methods equals and hashcode final, we can&#39;t
override them anymore and as so, we can&#39;t shadow them. </div>
    </div>
</div>
<br>Although I&#39;m not using SpringAOP, I believe my facts are not being shadowed.&nbsp; <br><br>Is it true that not using shadow facts may lead to non-deterministic behavior?&nbsp; Prior to shadow facts, the engine seemed to handle it.&nbsp; Any chance of reverting back to the old style of truth maintenance in the case of not using shadow facts.
<br><br>I apologize if I&#39;m not on the right track here.&nbsp; My only test case for my problem is the entire application right now, so I cannot offer it for discussion.&nbsp; Any advice would be greatly appreciated.<br><br>Thanks,
<br><span>-Chris West<br><br>
</span><br></span></div>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
</a>
<br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div>



<br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">



www.jboss.com</a>
<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br>
</span></div><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div>

<br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

www.jboss.com</a>
</span></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div>
<br>