Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (20 sloc) 749 Bytes
Rules Engine of MOSTFIT
It consists of
1) Main Files - lib/rules.rb
2) View - app/views/rules/
3) Controller - app/controllers/rules.rb
4) Model - app/models/rule.rb
This rule engine can handle multiple conditions (connected with and/or) simultaneusly and since the rules are compiled to respective models (using validates_with_method of datamapper), it produces
lowest overheads.
The rules can be manipulated in run-time without re-booting the server.
Internally, the rules engine uses BasicCondition(B) class (in lib/rules.rb) to represent a simple condition(S), a complex condition(C1) is either
C1 = [:not, C2]
C1 = [:and, C2, C3]
C1 = [:or. C2, C3]
C1 = [is_basic_condition = true, B]