Create a new instance of the RulesFileReader with the specified options for parsing rules from a file.
Optionaloptions: Partial<RulesFileReaderOptions>Optional configuration for the reader.
ProtectedremoveProtectedreadProtectedreadProtectedisProtectedisProtectedisParse the content of a rules file and return the result, including the successfully parsed rules and any errors encountered. If a Workspace was passed in options, that Workspace will be changed to reflect successful declarations.
The content of the rules file to parse.
The result of parsing, including the successfully parsed rules and any errors encountered.
Reader class for parsing rules files that contain rule definitions in text format. You should use this class to read rules from a text file, where each line (or block) defines a rule in the expected syntax (e.g. "IF condition THEN consequence"). The reader will parse the file content and return an object containing the successfully parsed rules as well as any errors encountered during parsing. The reader supports both line-by-line and block-by-block reading, allowing for flexible formatting of the rules file. It also includes error handling for invalid syntax, ensuring that the resulting rules array only contains valid AbstractRule instances that can be used within the rule engine.
N.B. This is a transactional safe reader. If you provide a workspace and select the option accept: 'all', then that workplace will not be affected if any errors are encountered.