https://github.com/sandesh300/Rule-Engine-Application
Rule Engine Validation & Error Handling Documentation
Rule String Validation
1. Syntax Validation
The rule engine performs the following syntax validations when processing rule strings:
a. Empty Rules
- Validation: Rules cannot be null or empty strings.
- Method:
validateRuleString()
- Error Message: "Rule string cannot be empty"
b. Parentheses Balance
- Requirement: Rules must have properly balanced parentheses.
- Validation Method: Tracks opening and closing parentheses count.
- Error Messages:
- "Invalid parentheses in rule" (negative balance)
- "Unmatched parentheses in rule" (non-zero final balance)
c. Logical Operators
- Requirement: Rules must contain at least one logical operator (AND/OR).
- Error Message: "Rule must contain at least one logical operator (AND/OR)"
d. Condition Format