[rules-users] Another question on how to use map

Brody bach brodybach at yahoo.com
Wed Jun 24 05:13:32 EDT 2009


Hi,

I need to put a map into the working memory and make some check on the
values

I have an object called Student with Id
And for every student there is a list of activity.
Each activity has date and the time for the activity
What I will be putting in the working memory looks as follows:

List<Student> studentList = getStudentList();
Map<Student, List<Activity>> studentActivityMap =
getStudentActivities(studentList);
List objects = new ArrayList();
objects.add(studentList);
objects.add(studentActivityMap);

ksession.execute(objects);

====================

Now i need to check for every student, if there is/are activity(ies)  which
needs more than 2 hours. If yes, give an output information which mention,
which student and on which day the activity is longer than 2 hours

when
$studentList : List
$std : Student($id : id) from $studentList
$activityList : ****how to get the list of activity for the student with
this $id from the given map *****
$act : Activity ($date : date, length >  180) from $activityList

then
(print something out using $id from std and $date from act) 


Would really appreciate any help and hints here

Regards 
bb
-- 
View this message in context: http://www.nabble.com/Another-question-on-how-to-use-map-tp24181278p24181278.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list