[rules-users] Detecting partial matches

elmo elmonazareno at yahoo.com
Fri Jan 12 22:55:55 EST 2007


Hi,
   
     Based on what you have given, I agree that you should separate this
into two rules. On a different note, my understanding of partial matches is
you have two different conditions, example age and height of a person. A
person may match the age but does not match the height requirements. If this
is your case, I suggest you keep a score in your object. Ex. if it matches
age, add 50. if it matches height, add 50. a score of 100 would be a full
match while a score of 50 is only a partial match. Then the final rule would
make it easier because you would only check the score. Just a thought.  

Regards,

Elmo    



Kevin J. Schmidt wrote:
> 
> I'm using JBoss Rules 3.0.5 and want to know if there is a way to
> detect when a rule partially matches. For example, let's say I have
> the following rule:
> 
> rule "My Rule"
>     no-loop true
> when
>     myo1: MyObject(id==12)
>     myo2: MyObject(id==45)
> then
>     // do something with myo1 and myo2
> end
> 
> This rule is looking for one MyObject with an id of 12 and another
> MyObject with an id of 45. A MyObject with id 12 may come into working
> memory before the one with an id of 45. Is there a way, either in Java
> code or in the rules file itself, to know when the rule is partially
> matched?
> 
> Thanks,
> 
> -- 
> Kevin J. Schmidt
> <kjschmidt at gmail.com>
> 
> A wise and frugal government, which shall leave men free to regulate
> their own pursuits of industry and improvement, and shall not take
> from the mouth of labor and bread it has earned - this is the sum of
> good government.
> --Thomas Jefferson
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://www.nabble.com/-rules-users--Detecting-partial-matches-tf2959940.html#a8311093
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list