<br>    Hi<br><br>    As a general advice, try to avoid using abstract data structures (lists, maps, etc) as facts, since they have no semantics in the problem domain. If you have students, insert each student in the working memory. If you have student activities, either have an activities list &quot;as a student attribute&quot;, or create a domain object that relates students to their activity list.<br>
<br>    If you do the above, rules will be so much simpler and more performant, that you will not regret. <br><br>    But, since you asked, I see no reason for you to not insert students directly, instead of the list of students. Your rule would be like:<br>
<br>when<br>    $std : Student( $id : id )<br>    $map : Map(  )<br>    $act : Activity ($date : date, length &gt;  180) from $map[$id]<br>then<br>end<br><br>    []s<br>    Edson<br><br><div class="gmail_quote">2009/6/24 Brody bach <span dir="ltr">&lt;<a href="mailto:brodybach@yahoo.com">brodybach@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi,<br>
<br>
I need to put a map into the working memory and make some check on the<br>
values<br>
<br>
I have an object called Student with Id<br>
And for every student there is a list of activity.<br>
Each activity has date and the time for the activity<br>
What I will be putting in the working memory looks as follows:<br>
<br>
List&lt;Student&gt; studentList = getStudentList();<br>
Map&lt;Student, List&lt;Activity&gt;&gt; studentActivityMap =<br>
getStudentActivities(studentList);<br>
List objects = new ArrayList();<br>
objects.add(studentList);<br>
objects.add(studentActivityMap);<br>
<br>
ksession.execute(objects);<br>
<br>
====================<br>
<br>
Now i need to check for every student, if there is/are activity(ies)  which<br>
needs more than 2 hours. If yes, give an output information which mention,<br>
which student and on which day the activity is longer than 2 hours<br>
<br>
when<br>
$studentList : List<br>
$std : Student($id : id) from $studentList<br>
$activityList : ****how to get the list of activity for the student with<br>
this $id from the given map *****<br>
$act : Activity ($date : date, length &gt;  180) from $activityList<br>
<br>
then<br>
(print something out using $id from std and $date from act)<br>
<br>
<br>
Would really appreciate any help and hints here<br>
<br>
Regards<br>
bb<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Another-question-on-how-to-use-map-tp24181278p24181278.html" target="_blank">http://www.nabble.com/Another-question-on-how-to-use-map-tp24181278p24181278.html</a><br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>