[rules-users] Wrting .drl code in DSLR
Wolfgang Laun
wolfgang.laun at gmail.com
Tue Jan 11 07:08:26 EST 2011
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 at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110111/87cb90ca/attachment.html
More information about the rules-users
mailing list