You can write

when
    There is a Customer
>  eval(isDiscountAllowed($Customer)) // function call
then

A leading '>' lets you write plain DRL.

Or, if you want to "hide" it behind some English, you define in DSL

[when][]who may be given a discount=eval(isDiscountAllowed($Customer))

when
    There is a Customer
    who may be given a discount
then


(There is nothing "dynamic" in your function. It's a DRL function, to be compiled, like a static Java method.)

-W


On 11 January 2011 12:48, Bala <bala.ganesh@accenture.com> wrote:

Sorry, I missed the explanation......

The function definition and call should be in dslr.

Can i define my dslr in the below format?

sample.dslr
*********
rule "name"
when
  There is a Customer
  eval(isDiscountAllowed($Customer)) // function call
then
 Log : "Message"
end

// function definition
 function boolean isDiscountAllowed(){
   return true;
}


Can i have the drl kindof coding in DSLR?

Thanks,
Bala
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Wrting-drl-code-in-DSLR-tp2233167p2233854.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users