[rules-users] Re: Salience type

Yuri ydewit at gmail.com
Tue Sep 4 17:53:50 EDT 2007


Yuri <ydewit <at> gmail.com> writes:
> 
> I have the following dynamic salience:
> 
> 	salience ( -10000 / (c.size * t.size) )
> 
> which throws a ClassCastException when it is not a whole division.

The workaround that worked for me was to use a function:

      salience ( -1 * FN.priority(c.size, c.size) )

(Using "-1 *" because just "-" does not work)


Here is the exception:

java.lang.ClassCastException: java.lang.Double
	at
org.drools.base.mvel.MVELSalienceExpression
.getValue(MVELSalienceExpression.java:33)





More information about the rules-users mailing list