[Discussion] Handling of the unregister function
There seems to be some confusion about the unregister function. We need to define when and how we can unregister rules and groups. The basic idea, when we only had rules was that, if rule A is dependent on rule B, rule B cannot be removed, except if unregistered with the cascade=True
option, in which case rule B and A both get removed. There are much more options now groups are added to the mix.
I have created a mock-up flow-chart, with many rules in there. We'd have to define what should happen, if one rule or group gets unregistered with or without the cascade=True
option and define if we need another option. I hope I added enough edge cases to make an informed decision.
RULES - What happens if:
- RandomVariableY gets removed:
- Without cascade: Does it get removed without a problem, or, because it is part of the
TOTAL PROCESS GROUP
, it cannot get removed because theINSERT INTO DB
is dependent on the group it is in? - With cascade: does anything happen to the
INSERT INTO DB
rule?
- Without cascade: Does it get removed without a problem, or, because it is part of the
- RandomVariableX gets removed
- without cascade: RandomVariableX cannot be removed as RandomVariableY is dependent on it.
- with cascade: RandomVariableX + RandomVariableY get removed. Do we care about the
INSERT INTO DB
?
- SomethingAboutValencia gets removed
- Without cascade: as it is the only rule in the
VALENCIA PROCESS GROUP
, is the process here different than in case (1)? - With cascade: Does the group get removed too & therefore the DependentOnValencia?
- Without cascade: as it is the only rule in the
- SelectValenciaCadastre:
- Without cascade: it is clear that it cannot be removed, as a rule is dependent on this rule
- With cascade: SomethingAboutValencia gets removed, therefore also the
VALENCIA PROCESS GROUP
& DependentOnVAlencia rule?
GROUPS - What happens if:
-
SELECT BUILDING GROUP
gets removed:- Without cascade: cannot happen, rules depend on it
- With cascade: All rules in the group get removed, as well as CalculateFootprintArea & CalculateFloorspace
-
TOTAL SELECT GROUP
gets removed:- Without cascade: cannot happen, rules depend on it
- With cascade: All rules in the
TOTAL PROCESS GROUP
get removed. Therefore, the group gets removed too? Therefore, every single rule gets removed here?
-
VALENCIA PROCESS GROUP
is removed, in the case theDependentOnValencia
dependency would not be there:- Without cascade: We remove all rules in the group?
- With cascade: We remove all the rules in the group.
Edited by Chengzhi Rao