[rules-users] creating a rule regarding an element of list stored in an object in a list

Stephen Masters stephen.masters at me.com
Fri Apr 5 04:50:50 EDT 2013


Just thought I'd mention that I hadn't replied to this, because it looks way too much like comp-sci homework. Not sure whether that's the same reason others haven't replied either. ;)

A hint though to get you started. You can probably use something like...

$student: Student(grade != null) from $roster

… with a few lines before that to pick out the roster in a similar fashion.

To understand it, check out the Drools Expert manual for the "from" operator for working with lists/collections.

Steve


On 3 Apr 2013, at 19:59, burmanator <alexburman at gmail.com> wrote:

> So the example I am working with is this:
> You have a Teacher object
>     that stores a list of Rosters  objects
>           in each Roster is a list of Students objects
>                each Student has a grade value
> 
> How would I go about creating a rule to find all the students that got As
> for a given Teacher across all her Rosters?
> 
> 
> 
> --
> View this message in context: http://drools.46999.n3.nabble.com/creating-a-rule-regarding-an-element-of-list-stored-in-an-object-in-a-list-tp4023205.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list