[rules-users] Query on loading facts dynamically

jobin wilson jobinwilson at gmail.com
Wed Jun 30 03:52:11 EDT 2010


Hello List,

I have a very basic question about inserting facts into the working memory
dynamically.For firing the rules,we should be having all our facts in the
working memory.In that case,How will we deal with the situation where the
facts that we need for evaluation of a particular rule is dependent on the
rule itself (needs to be brought it dynamically)?

Say for example say i want to use rule engine to reward all students with
average scores for all subjects > 75 for the past 3 exams.

The facts that i have are the Student objects & their Subject wise
scores(one to many relation;one student to many exams & each exams having
many subjects).
I want the "when" condition to be satisfied for all students whose average
scores for all subjects for the past 3 exams to be greater than 75
and the consequence to be to just print out the name of the student.

In this case,should i be loading all the student objects & each of their
past exam scores in the whole system to find student objects satisfying this
critera?
Since i already know that the rule just need the average scores for just the
past 3 exams for each student,wouldn't loading the whole facts be
inefficient?
Is there a way in which i can specify somehow how much of the facts needs to
be loaded before firing the rule based on the rule itself?
i mean a rule which is aware of the quantity of the facts on which it needs
to work on(considering loading 3 facts versus 100 facts)?

Thanks a lot in advance for all your inputs and suggestions on this.

Thanks & Regards
Jobin Wilson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100630/0b5b9a6b/attachment.html 


More information about the rules-users mailing list