Created
December 23, 2012 04:41
-
-
Save danveloper/4361997 to your computer and use it in GitHub Desktop.
Example enrollment rules engine
This file contains 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
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