<div>Hi Edson,</div><div><br></div>Thanks for a quick reply.<div><br></div><div>Regarding the second second point I will open an issue in JIRA.</div><div><br></div><div>Regarding the first one is that a bug as well? since I haven't assert any of the vehicle instances I suppose the rule shouldn't fire right? But the rule is firing always.</div>
<div><br></div><div>Thanks,</div><div>sudhir.<br><br><div class="gmail_quote">On Tue, Feb 3, 2009 at 6:49 PM, Edson Tirelli <span dir="ltr"><<a href="mailto:tirelli@post.com">tirelli@post.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br> Regarding 1, it is the expected behavior, since there is no vehicle in the wm whose model is not "bmw".<br><br> Regarding 2, probably a bug. Can you please open a JIRA with a test case?<br><br> []s<br>
Edson<br><br><div class="gmail_quote">2009/2/3 Sudhir M <span dir="ltr"><<a href="mailto:sudhir.cse@gmail.com" target="_blank">sudhir.cse@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div><div></div><div class="Wj3C7c">
Hi ALL,<div><br></div><div>We are using drools 4.0.7 for one of our projects. We encountered some issues which I thought are strange.</div><div><br></div><div>1. When using FORALL on an entity for which we haven't asserted any of the instances in the working memory the rule always fires. I thought this rule should be evaluted to true only if all the asserted instances satisfy the condition and if we don't insert any of the instances in the working memory it should no fire the rule. Is this the expected behaviour or am I wrong?</div>
<div><br></div><div> ex: rule "rule1"</div><div><span style="white-space:pre">        </span> when</div><div><span style="white-space:pre">                </span>forall (</div><div><span style="white-space:pre">                </span> Vehicle( model == "bmw" )</div>
<div><span style="white-space:pre">                </span>)</div><div><br></div><div><span style="white-space:pre">        </span> then</div><div> System.out.println("in forall");end</div>
<div><br></div><div>2. When using 'contains' operator on array or collection of strings its working fine. But when we use it for an array of primitive type double it gives a classcastexception . Is auto boxing not supported? May be this is fine as it mentioned in the documentation that it works only on Objects. I tried using the array of Double objects, here it doesn't throw an excpetion but the rule wasn't firing. The behaviour was same even if I use a collection of Double objects. Is this a bug or am I missing something?</div>
<div><br></div><div> ex: </div><div><span style="font-weight:bold">using Array</span></div><div><br></div><div> rule "OrderArray"</div><div><span style="white-space:pre">        </span> when</div>
<div><br></div><div><span style="white-space:pre">                </span> Order(valueArray contains 0)</div><div><br></div><div><span style="white-space:pre">        </span> then</div><div> System.out.println("OrderArray");<br>
</div><div>end.</div><div><br></div><div><span style="font-weight:bold">using Collection</span></div><div><span style="font-weight:bold"><br></span></div><div><span style="font-weight:bold"><br>
</span></div><div><span style="font-weight:bold"><span style="font-weight:normal"><div> rule "OrderList"</div><div><span style="white-space:pre">        </span> when</div>
<div><br></div><div><span style="white-space:pre">                </span> Order(valueList contains 0)</div><div><br></div><div><span style="white-space:pre">        </span> then</div><div> System.out.println("OrderList");<br>
</div><div>end.</div><div><br></div><div>May be for collections I can write it as below </div><div><br></div><div><br></div><div><div>rule "OrderList"</div><div><span style="white-space:pre">        </span> when</div>
<div><br></div><div><span style="white-space:pre">                </span>$order : Order( $val:valueList)</div><div> Double(doubleValue ==0) from $val</div><div><br></div><div><span style="white-space:pre">        </span> then</div>
<div> System.out.println("OrderList");<br></div><div>end. but this working but not intuitive as these rules were maintained later by a business user it will be easy for him if we contains and also if we can directly use array instead of collections it would be a great as current BOM uses arrays everywhere.</div>
<div><br></div><div>Thanks,</div><div>sudhir.</div></div></span></span></div><font color="#888888"><div><br></div><div><br></div><div><br></div><div><br></div>
</font><br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</font><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>
<br></blockquote></div><br></div>