Created
March 11, 2016 09:16
-
-
Save garethahealy/6a2407d6ce8d401253a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.acme.insurance.policyquote | |
| import org.acme.insurance.Driver | |
| import org.acme.insurance.Policy | |
| rule "RiskyAdults" | |
| when | |
| //conditions | |
| driver : Driver(age > 24, numberOfAccidents >= 1 || numberOfTickets >=2) | |
| policy : Policy(price == null, policyType == "AUTO") | |
| then | |
| //actions | |
| modify(policy) {setPrice(300)}; | |
| System.out.println("fired rule " + kcontext.getRule().getName()); | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment