[rules-users] collect return random order
Yang Song
starsy at gmail.com
Mon Aug 27 11:27:44 EDT 2007
I saw someone is requesting LIMIT, here I saw Manukyan is asking for ORDER
BY, and also Mark is talking the FROM. Looks like the rule LHS part would
become more and more like SQL SELECT statement. :)
I think it is the right way. Some Stream Database also extends the SQL to do
event aggregation and correlation. The same can be applied to Rule Engine
too.
Yang
On 8/27/07, Manukyan, Sergey <SManukyan at lear.com> wrote:
>
> Folks,
>
>
>
> When using collect on List of items with some filter (criteria), I need to
> have result in the same order as it was received:
>
>
>
> F.e. I have a list of suppliers :
>
>
>
> List() : Supplier("FIRST", Status.ACTIVE), Supplier("SECOND",
> Status.INACTIVE), Supplier("THIRD", Status.INACTIVE)
>
>
>
> And I need to find first INACTIVE supplier, so it must be SECOND supplier.
>
>
>
> So doing the following :
>
>
>
>
>
> When
>
> $l : List() // list of suppliers
>
> $inactive_supp : ArrayList() from collect Supplier(status ==
> Status.INACTIVE) from $l
>
> Then
>
> System.out.println($l); // prints FIRST, SECOND, THIRD
>
> System.out.println($inactive_supp); // prints THIRD, SECOND …. Instead
> of SECOND , THIRD
>
>
>
>
>
> So I am getting THIRD supplier instead of SECOND as the result..
>
>
>
> Please advise if it is a bug .., or there is another way of doing that…
>
>
>
> Thanks,
>
>
>
> -Sergey
>
>
>
>
>
>
> **********************
> ** LEGAL DISCLAIMER **
> **********************
>
> This E-mail message and any attachments may contain
> legally privileged, confidential or proprietary
> information. If you are not the intended recipient(s),
> or the employee or agent responsible for delivery of
> this message to the intended recipient(s), you are
> hereby notified that any dissemination, distribution
> or copying of this E-mail message is strictly
> prohibited. If you have received this message in
> error, please immediately notify the sender and
> delete this E-mail message from your computer.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070827/66fbb7d7/attachment.html
More information about the rules-users
mailing list