<br> Hi Fabrice,<br><br> That is how it is supposed to work... no "automatic" way of doing it in another way.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/10/23, Fabrice Granzotto <
<a href="mailto:granz@mit.edu">granz@mit.edu</a>>:</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("kitchen");<br>Location office=new Location("office");<br>Container container1=new Container("container1",kitchen);
<br>session.insert(container1);<br>Item chocolate=new Item("chocolate", container1);<br>session.insert(chocolate);<br>session.fireAllRules();<br>//No rules fired => OK<br>container1.setLocation(office);<br>session.update
(session.getFactHandle(container1), container1);<br>session.fireAllRules();<br>//Once again, no rules fired => Not OK... I want detect this movement<br><br>*******RULE *******<br>rule "An item is in the office"
<br> salience 0<br> when<br> $itemA : Item($cont : container, $cont.location.name=="office")<br> then<br> System.out.println("item in office");<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> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a>