[rules-users] drools dynamic LHS

Leonardo Gomes leonardo.f.gomes at gmail.com
Tue May 24 14:54:01 EDT 2011


You can have a fact that stores those values:

rule "Check Age"
       when
               Context($ageLimit : age)
               Person(age > $ageLimit)
       then
             do something...
end

On Tue, May 24, 2011 at 6:33 PM, marunam <sutavis at gmail.com> wrote:

> Hello,
>
> I have a question about having dynamic LHS in drool rules. Below is what I
> am looking for
>
> rule "Check Age"
>        when
>                Person(age > 24)
>        then
>              do something...
> end
>
> What is the best way to keep the actual fact data dynamic(i.e. 24 in this
> case) and how do I feed it do drools
> This is very simple rule and the only fact value(hardcoded) that I have is
> "24". I may have complex rules in which I could have many fact values for
> different attributes. I am looking for a solution where I don't hard code
> any value in the rule
>
> Thank you for looking into this and your response
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/drools-dynamic-LHS-tp2980536p2980536.html
> Sent from the Drools: User forum 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/20110524/72894e04/attachment.html 


More information about the rules-users mailing list