[rules-users] parametrized rules
Michael Anstis
michael.anstis at gmail.com
Mon Apr 2 10:19:50 EDT 2012
Sure, look at using Templates.
On 2 April 2012 15:18, Tim van Heugten <stimme at gmail.com> wrote:
> Hi all,
>
> I'm new to Drools, and wonder how I can most cleanly write down rules for
> the following.
>
> (For the sake of example) Say I have an object that needs to be processed
> season-dependent. I basically need a rule like:
> rule
> when
> Date( month == X, day >= Y, day <= Z)
> // Some date containing object
> then
> System.out.println("Season is "+R)
> // Store season in associated object
> end
>
> And fill in X, Y, Z and R with:
> X Y Z R
> 1 1 31 Winter
> 2 1 29 Winter
> 3 1 21 Winter
> 3 22 31 Spring
> 4 1 30 Spring
> 5 1 31 Spring
> 6 1 21 Spring
> 6 22 30 Summer
> 7 1 31 Summer
> ...
>
>
> Should I expand all this rules by hand, and define 16 rules in my rule
> file? Or can I parametrize the rules and have this done automagically?
>
> Thanks a lot,
>
> Tim van Heugten
>
> _______________________________________________
> 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/20120402/aeb4c99d/attachment.html
More information about the rules-users
mailing list