[rules-users] Re: functions over the rule template of a Condition in a Decision Table

javier correoalternativo.jjcb at gmail.com
Mon Sep 22 07:05:39 EDT 2008


....javier :
.... Hello, It is posible to write a function 
.... over the rule template of a CONDITION in a Decision Table?
.... I mean instead of write the rule template:    
....    driver.priorClaims 
.... write the rule template: 
....    driver.priorClaims("lastWeek")
 
...Edson Tirelli writes:
...    Place it inside an eval(). Use the regular "$" syntax for paramenters.  

..Javier writes:
..Edson, could you give me an example?
 
.Javier writes:
.Edson, "A inline-eval constraint can use any valid dialect expression as long
as it is evaluated to a primitive boolean "
.But I need to return a number or strign that matchs with the value of a cell in
the decision table.
.Any other idea?
 

Ok, you are right!

i have write the condition as:
 eval(driver.checkPriorClaims("lastWeek",$param))
and i have implement in Driver, checkPriorClaims(String period,int numberToCheck)

note, in case of the cell values will bew strings, the condition will be:
 eval(driver.checkPriorClaims("lastWeek","$param")), and the method in Driver
will be checkPriorClaims(String period,String paramToCheck)

Thank you very much.

javi















More information about the rules-users mailing list