RulesEngine v0.1.0 RulesEngine View Source

a Rules Engine that applies rules according to their natural order (which is priority by default).

Link to this section Summary

Functions

will fire (run) the provided rules against the provided facts on a RulesEngine which has been set up with the provided (RulesEngine) parameters

to implement the “skip_on…” parameters, we need to do an Enum.take_while first, to get the rules that will happen BEFORE the skip, and then do an Enum.each (or similar) to process them

will sort the rules (map) by priority with lowest priority value coming first. Will return a list

Link to this section Functions

Link to this function fire(params, rules, facts) View Source
fire(RulesEngineParameters.t(), [Rule.t()], map()) :: any()

will fire (run) the provided rules against the provided facts on a RulesEngine which has been set up with the provided (RulesEngine) parameters.

Link to this function get_pre_skip_rules(params, sorted_rules, facts) View Source

to implement the “skip_on…” parameters, we need to do an Enum.take_while first, to get the rules that will happen BEFORE the skip, and then do an Enum.each (or similar) to process them

will sort the rules (map) by priority with lowest priority value coming first. Will return a list.