[rules-users] facts custom sort

Syargey Syargey at tut.by
Sat Nov 26 12:37:08 EST 2011


Hello all,

I experienced a problem I can't solve.

After rules firing I got a number of facts of certain type.

I would like to get a collection of facts sorted by custom field with a
query.

Drools guide proposes to sort facts by a rule like:

rule "Rule 03"   
when
	$number : Number( )
	not Number( intValue < $number.intValue )
then
	System.out.println("Number found with value: "+$number.intValue() ); 
	retract( $number );
end

But it doesn't suit me:
1) I can't retract facts from session
2) I need to get sorted collection with a query which doesn't have 'then'
part.

Is there any method to get custom sorted collection with a query?



--
View this message in context: http://drools.46999.n3.nabble.com/facts-custom-sort-tp3538410p3538410.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list