123456789101112131415161718192021 |
- package com.redhat.training.rules
- rule "Silver Loyalty is 15% Discount"
- ruleflow-group "discount"
- when
- c: Customer(loyaltyLevel == LoyaltyLevel.SILVER)
- t: Ticket(customer == c)
- then
- System.out.println("Setting SILVER discount: 15%");
- t.setDiscountPercent(15);
- end
- rule "Gold Loyalty is 25% Discount"
- ruleflow-group "discount"
- when
- c: Customer(loyaltyLevel == LoyaltyLevel.GOLD)
- t: Ticket(customer == c)
- then
- System.out.println("Setting GOLD discount: 25%");
- t.setDiscountPercent(25);
- end
|