Use some ordered collection, like a TreeSet. It will order them for u<br><br><div class="gmail_quote">On Tue, Feb 17, 2009 at 4:35 PM, techy <span dir="ltr"><<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
That's makes Edson. Thank you.<br>
<br>
Is there way to to sort the facts collected using "collect" in LHS itself? I<br>
could not find any hint in the documentation.<br>
<br>
<br>
<br>
Edson Tirelli-3 wrote:<br>
><br>
> That is expected behavior.<br>
><br>
> This is because quantifier CEs like "exists", "not" and "forall" will<br>
> evaluate multiple facts at once. So, if your rule has 5 foos in the<br>
> working<br>
> memory, which one would you expect to print?<br>
><br>
> If you want to print each of them, remove the "exists"... if you want<br>
> to<br>
> print all of them, use "collect" instead of "exists".<br>
><br>
> []s<br>
> Edson<br>
><br>
> 2009/2/17 techy <<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>><br>
><br>
>><br>
>> I get $foo can't be resolved error for following rule. Some guidance is<br>
>> appreciated to reference $foo without error.<br>
>><br>
>> Rule "Foo rule"<br>
>> when<br>
>> exists( $foo: Foo())<br>
>> then<br>
>> System.out.println($foo);<br>
>> end<br>
>><br>
>> Thanks in advance.<br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22063253.html" target="_blank">http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22063253.html</a><br>
>> Sent from the drools - user mailing list archive at Nabble.com.<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>
>><br>
><br>
><br>
><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>
><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>
><br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22066856.html" target="_blank">http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22066856.html</a><br>
Sent from the drools - user mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>