[rules-users] counting facts of a kind
Wolfgang Laun
wolfgang.laun at gmail.com
Mon Aug 23 07:16:31 EDT 2010
As simple as it gets:
rule countHigh
when
$n : Number() from accumulate ( $sgc : StartGoalConn() count( $sgc ) )
then
System.out.println( "plain routes: " + $n );
end
And yet, it fails:
Exception in thread "main" org.drools.RuntimeDroolsException:
java.lang.ClassCastException: rss.ixl.route.TrainStartGoalConn cannot be
cast to java.io.Serializable
Sure, adding "implements Serializable" to StartGoalConn fixes this. But why
is this necessary?
FYI, StartGoalConn is abstract superclass of TrainStartGoalConn - just in
case this has some bearing on this issue.
Best
-W
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100823/92ed3b0a/attachment.html
More information about the rules-users
mailing list