Closed v912485 closed 3 years ago
@v912485 is this going to involve an external validator-script from drools lib or just a "shallow" validator of rules structure? Currently the parsing regex does not allow rules that don't meet the general rule pattern: <rule "name" .... end>. Thus, any rule that does not have a proper beginning and end is automatically excluded
Yes, we will probably need to create some validator API.
commit 5354d90 contains changes of how the UI handles validation: no extra validation button is there. Validation is integrated in the SAVE-CHANGES button. Also validation service is not an exposed API any more but a server method that is triggered by the SAVE-RULE API.
https://github.com/sotiriosalpha/rulesMS/blob/5354d907b317616f5f68bce25b66ae895d4473eb/server/api/rules.js#L151-L155 https://github.com/sotiriosalpha/rulesMS/blob/5354d907b317616f5f68bce25b66ae895d4473eb/server/api/functions/validate.js#L26-L43
Before saving a rule the system should automatically check if the rule validates before saving. There should be a configurable option in the system that enforces validation before saving is allowed or whether invalid rules are still allowed to be saved.