* Returns a new Engine instance * @param {Rule[]} rules - array of rules to initialize with
(rules = [], options = {})
| 19 | * @param {Rule[]} rules - array of rules to initialize with |
| 20 | */ |
| 21 | constructor (rules = [], options = {}) { |
| 22 | super() |
| 23 | this.rules = [] |
| 24 | this.allowUndefinedFacts = options.allowUndefinedFacts || false |
| 25 | this.allowUndefinedConditions = options.allowUndefinedConditions || false |
| 26 | this.replaceFactsInEventParams = options.replaceFactsInEventParams || false |
| 27 | this.pathResolver = options.pathResolver |
| 28 | this.operators = new Map() |
| 29 | this.facts = new Map() |
| 30 | this.conditions = new Map() |
| 31 | this.status = READY |
| 32 | rules.map(r => this.addRule(r)) |
| 33 | defaultOperators.map(o => this.addOperator(o)) |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Add a rule definition to the engine |
nothing calls this directly
no test coverage detected