<br>&nbsp;&nbsp; Hi Fabrice,<br><br>&nbsp;&nbsp; That is how it is supposed to work... no &quot;automatic&quot; way of doing it in another way.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/10/23, Fabrice Granzotto &lt;
<a href="mailto:granz@mit.edu">granz@mit.edu</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;">Hi everybody!<br><br>Here is my code and my rule. The problem is that the rule doesn?t detect that
<br>my item ?chocolate? contained in the container has moved to the<br>?office?.<br><br>I know that if I update the item instead the container it?s working, but I was<br>wondering if there is a solution to detect this movement by this way? Do you
<br>have a solution?<br><br>Thanks!<br><br>*******CODE *******<br>session = ruleBase.newStatefulSession();<br>Location kitchen=new Location(&quot;kitchen&quot;);<br>Location office=new Location(&quot;office&quot;);<br>Container container1=new Container(&quot;container1&quot;,kitchen);
<br>session.insert(container1);<br>Item chocolate=new Item(&quot;chocolate&quot;, container1);<br>session.insert(chocolate);<br>session.fireAllRules();<br>//No rules fired =&gt; OK<br>container1.setLocation(office);<br>session.update
(session.getFactHandle(container1), container1);<br>session.fireAllRules();<br>//Once again, no rules fired =&gt; Not OK... I want detect this movement<br><br>*******RULE *******<br>rule &quot;An item is in the office&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;salience 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$itemA : Item($cont : container, $cont.location.name==&quot;office&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;item in office&quot;);<br>end<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">https://lists.jboss.org/mailman/listinfo/rules-users
</a><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">www.jboss.com</a>