Skip to content

Instantly share code, notes, and snippets.

@danveloper
Created December 23, 2012 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danveloper/4361997 to your computer and use it in GitHub Desktop.
Save danveloper/4361997 to your computer and use it in GitHub Desktop.
Example enrollment rules engine
class EnrollmentRulesEngine extends RulesEngineSupport<Student> implements RulesEngine {
def dormHallRule = { obj ->
if (obj.gpa >= 3.5) {
obj.@dormHall = Student.DormHall.Honors
} else if (obj.gpa >= 3.0) {
obj.@dormHall = Student.DormHall.Preferred
} else {
obj.@dormHall = Student.DormHall.Normal
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment