Hi all.
I was trying to create some slightly complicated rules which essentially needed the if else construct. After fiddling around for a while, I was able to write the correct rules and check them using my Eclipse.
However, the ultimate aim is to have my user create custom "on-the-fly" rules for which we chose the Drools Workbench as the UI. However, even after repeated searching and struggling, I'm unable to get this done in the workbench.
Is it possible to have an if-else construct in the Workbench?
What I'm looking for is somewhat similar to this example taken from the documentation.
rule "Give free parking and 10% discount to over 60 Golden customer and 5% to Silver ones"
when
$customer : Customer( age > 60 )
if ( type == "Golden" ) do[giveDiscount10]
else if ( type == "Silver" ) break[giveDiscount5]
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
then[giveDiscount10]
modify($customer) { setDiscount( 0.1 ) };
then[giveDiscount5]
modify($customer) { setDiscount( 0.05 ) };
end
Thanks and regards :)
Harshal Joshi