This would certainly work, but you should evaluate the performance carefully.  
This is a cartesian join, and will run the eval() statement (number of 
CoApplicant objects) * (number of Contract objects) on startup, (number of 
CoApplicant objects) times when ANY Contract changes or is asserted, and 
(number of Contract objects) times when ANY CoApplicant changes or is asserted. 
 It's basically the worst case for rule performance. 

--- On Fri, 1/16/09, [email protected] <[email protected]> 
wrote:

> From: [email protected] <[email protected]>
> Subject: Re: [rules-users] or condition - subrules
> To: "Rules Users List" <[email protected]>
> Date: Friday, January 16, 2009, 10:57 AM
> I think I found the answer to my question:
> 
> rule "Test"
>         when 
>                 CoApplicant( $relationship : relationship )
>                 Contract ( $state : state )
>                 eval ($relationship == "S" ||
> $state == "CO" || $state == 
> "IL")
> ...
> 
> Thanks
> 
> 
> 
> [email protected] 
> Sent by: [email protected]
> 01/16/2009 11:40 AM
> Please respond to
> Rules Users List <[email protected]>
> 
> 
> To
> [email protected]
> cc
> 
> Subject
> [rules-users] or condition - subrules
> 
> 
> 
> 
> 
> 
> 
> I understand that as this rule is written below it will be
> compiled into 2 
> subrules which both fire.  I searched the archives and
> found a post where 
> Mark Proctor suggested "Bind each pattern, and do the
> || field constraints 
> in an eval.". I'm new to Drools, can someone
> elaborate on how I would do 
> that with the rule below? 
> 
> rule "Test"         
>         when         
>                 (CoApplicant( relationship == "S"
> ) or (Contract ( state 
> in ("CO", "IL")))) 
>         then 
>         ... 
> 
> Thanks 
> 
> Kent    _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>  
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users


      
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to