|
Re: [drools-user] Three Important Doubts: msg#00147java.drools.user
Hi Joj, 1) and 2) In this case it is appropriate to use the declarations (bound variable) for your properties of the class Student, and the eval complementary element for column (read the drools manual http://labs.jboss.com/portal/jbossrules/docs). Drools doesn't allow you to operate with class properties in columns, as you suggest in your example, but it offers you an alternative: the declarations. s : Student( m1:mark1, m2:mark2 ) eval ( m1.intValue() + m2.intValue() >= 100) eval (m1.intValue() > m2.intValue()) 3) Here is a simple example about the use of accessors for bean objects. rule "EvalWithFunction_1" when $e:Employee($name:employeeName == "Fred") e val($e.getExtraHours() >= 8) eval($e.getCurrencyName() == "EURO") then System.out.println($name+" has worked at least 8 extra hours"); end $e is a fact declaration , and $name is a field declaration. getExtraHours() - is a getter for extraHours field. Eval can contain any predicate _expression_ as long it returns a primitive boolean. It is usually used to refer variable that were bound previously in the LHS of the rule, and functions with parameters in the rule package. In the LHS structure, the eval element(s) should be the last. An eval element will be checked each time if all the conditions in the rule are met. Best regards, Oana. Joj <jojpm@yaho o.com> wrote:
__________________________________________________
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [drools-user] Doubts in Bound Variables, Niyas |
|---|---|
| Next by Date: | Re: [drools-user] Doubts in Bound Variables, nicolae oana |
| Previous by Thread: | [drools-user] Three Important Doubts, Joj |
| Next by Thread: | Re: [drools-user] Three Important Doubts, Joj |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |