[rules-users] How to create DSL template that produces rules based on arbitrary user's input?

Yu Wang yuwarm at gmail.com
Fri Aug 8 10:24:49 EDT 2008


I think you may write a litte compiler to generate this rule of rules. ;)
or just write 5 templates.


On 8/6/08, psentosa <psentosa at yahoo.com> wrote:
>
>
> Hi all,
>
> This newbie has the following problem:
>
> I'd like to let rules-creator to input something arbitrary, and the
> corresponding rules are produced.
> To be concrete, he'd like to be able to write the following condition:
>
> When
>         I play only on "Monday", "Thursday", "Friday"
> Then
>         I'll get 3000
>
> But it should also be possible that he only inputs "Monday", or
> "Monday","Tuesday","Wednesday","Thursday".
> So the number of days to be input should be arbitrary.
> With my current understanding, I could only put some placeholders (in the
> example above:
>
> I play only on {day1} {day2} {day3} .....  --> $player : Player (1stday ==
> {day1} && 2ndday == {day2} && 3rdday == {day 3})
>
> I'll get {number} --> $player.setPayment(number)
>
> Hope I explained this correctly...any tipps? Or should I really create on
> template for 1 day only, another template for 2 days only, and so on?
> Thanks a lot
>
> --
> View this message in context:
> http://www.nabble.com/How-to-create-DSL-template-that-produces-rules-based-on-arbitrary-user%27s-input--tp18850282p18850282.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/20080808/d69a2319/attachment.html 


More information about the rules-users mailing list