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

psentosa psentosa at yahoo.com
Wed Aug 6 08:37:30 EDT 2008


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.




More information about the rules-users mailing list