Skip to content

Instantly share code, notes, and snippets.

@garethahealy
Created March 11, 2016 09:16
Show Gist options
  • Save garethahealy/6a2407d6ce8d401253a1 to your computer and use it in GitHub Desktop.
Save garethahealy/6a2407d6ce8d401253a1 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 "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