Draft: Resolve "Introduce groups and dependencies on groups"
Closes #19
Introduce groups for rules and dependencies. The discussion of the action plan for "how to implement the de-registering of rules and groups " can be found in the related Issue RL#25, the examples to elaborate on the edge cases are in the list.
Main changes:
-
<dependencies>
can have two parameters, one for the individual rules, another for the groups which dependents on. - If one rule belongs to a group, it should have a
<groups>
tag. -
RuleHandler
will capture the changes of groups and the rules inside of the groups dynamically, with the checking of graph and group relations validilty. - Add and adapt the
deregister
functions for rules and groups, since if remove a rule inside a group or remove a group can affect the entire program, more constraints and conditions are included. - Optimalize the
register()
,check_valid_graph()
andcheck_valid_group()
, to guarantee the failed registration would not change the previousRuleHandler
.
Tests:
-
test if all the groups and the rules inside the groups are registered in to the RuleHandler.graph
. -
test if the program gives an error if the group(s) are not valid, and the invalid group(s) and related rule(s) will be removed from the program. -
test if the de-registration of rules and groups is correct, with or without cascade
, the updates of graph, groups are valid. -
test if a group where a rule is dependent on is executed before the rule itself. -
test if it works with multiple groups. -
test if the program fails when an invalid group is introduced in the process of registration. -
test if circle dependency fails (two groups dependent on each other).
Edited by Chengzhi Rao