[rules-users] Accumulator - Syntax question

joseph berdat joseph.berdat at finaware.ch
Thu Sep 3 02:19:28 EDT 2009


Hello,

The rule below check which quote have a price above the average.
In this form the rule is working, but from the log files it seems that  
this rule is doing a cross join.

rule "above average value"
	dialect "mvel"
	when
         	Double( $average : doubleValue) from  
accumulate( Quote( $price : value ), average( $price ) )
		$quote : Quote(value > $average)
	then
     		System.out.println("Quote above average [" + $quote.id + "]  
value [" + $quote.value + "]  average [" + $average + "]")
end

I could not get the correct syntax. I would like to write something  
like:

when
	Quote(value > doubleValue) from accumulate( Quote( $price : value ),  
average( $price ) )

Thanks,
regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090903/8526d2bb/attachment.html 


More information about the rules-users mailing list