@@ -11,7 +11,7 @@ The Engine stores and executes rules, emits events, and maintains state.
1111 * [ engine.removeRule(Rule instance)] ( #engineremoverulerule-instance )
1212 * [ engine.addOperator(String operatorName, Function evaluateFunc(factValue, jsonValue))] ( #engineaddoperatorstring-operatorname-function-evaluatefuncfactvalue-jsonvalue )
1313 * [ engine.removeOperator(String operatorName)] ( #engineremoveoperatorstring-operatorname )
14- * [ engine.run([ Object facts] , [ Object options] ) -> ; Promise ({ events: Events, almanac: Almanac, successResults : [ ] , failureResults: [ ] })] ( #enginerunobject-facts-object-options---promise--events-events-almanac-almanac-successresults--failureresults- )
14+ * [ engine.run([ Object facts] , [ Object options] ) -> ; Promise ({ events: Events, almanac: Almanac, results : [ ] , failureResults: [ ] })] ( #enginerunobject-facts-object-options---promise--events-events-almanac-almanac-successresults--failureresults- )
1515 * [ engine.stop() -> ; Engine] ( #enginestop---engine )
1616 * [ engine.on('success', Function(Object event, Almanac almanac, RuleResult ruleResult))] ( #engineonsuccess-functionobject-event-almanac-almanac-ruleresult-ruleresult )
1717 * [ engine.on('failure', Function(Object event, Almanac almanac, RuleResult ruleResult))] ( #engineonfailure-functionobject-event-almanac-almanac-ruleresult-ruleresult )
@@ -104,9 +104,6 @@ engine.addRule(rule)
104104engine .removeRule (rule)
105105```
106106
107-
108-
109-
110107### engine.addOperator(String operatorName, Function evaluateFunc(factValue, jsonValue))
111108
112109Adds a custom operator to the engine. For situations that require going beyond the generic, built-in operators (` equal ` , ` greaterThan ` , etc).
@@ -156,7 +153,7 @@ engine.removeOperator('startsWithLetter');
156153
157154
158155
159- ### engine.run([ Object facts] , [ Object options] ) -> Promise ({ events: Events, almanac: Almanac, successResults : [ ] , failureResults: [ ] })
156+ ### engine.run([ Object facts] , [ Object options] ) -> Promise ({ events: Events, almanac: Almanac, results : [ ] , failureResults: [ ] })
160157
161158Runs the rules engine. Returns a promise which resolves when all rules have been run.
162159
@@ -168,12 +165,13 @@ await engine.run()
168165await engine .run ({ userId: 1 })
169166
170167// results
171- const runResult = await engine .run ({ userId: 1 })
168+ const { results , failureResults , events } = await engine .run ({ userId: 1 })
172169
173170/**
174- * runResult.almanac: Almanac instance for the run
175- * runResult.successEvents: rule results for successful rules
176- * runResult.failureEvents: rule results for failed rules
171+ * almanac: Almanac instance for the run
172+ * results: rule results for successful rules
173+ * failureResults: rule results for failed rules
174+ * events: successful events
177175 */
178176```
179177Link to the [ Almanac documentation] ( ./almanac.md )
0 commit comments