Skip to content

Instantly share code, notes, and snippets.

@garethahealy
Created March 11, 2016 09:15
Show Gist options
  • Save garethahealy/e34b097850da686632c9 to your computer and use it in GitHub Desktop.
Save garethahealy/e34b097850da686632c9 to your computer and use it in GitHub Desktop.
package org.acme.insurance.policyquote
import org.acme.insurance.Driver
import org.acme.insurance.Policy
rule "SafeYouths"
when
//conditions
driver : Driver(age >= 18 && < 25, numberOfAccidents < 1, numberOfTickets <= 1)
policy : Policy(price == null, policyType == "AUTO")
then
//actions
modify(policy) {setPrice(450)};
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