Skip to content

Instantly share code, notes, and snippets.

@garethahealy
Created March 11, 2016 09:16
Show Gist options
  • Save garethahealy/223ca97b9e127a0c050c to your computer and use it in GitHub Desktop.
Save garethahealy/223ca97b9e127a0c050c 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 "SafeAdults"
when
//conditions
driver : Driver(age > 24, numberOfAccidents < 1, numberOfTickets <= 1)
policy : Policy(price == null, policyType == "AUTO")
then
//actions
modify(policy) {setPrice(120)};
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