diff --git a/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts b/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts index ae1f18a373..44087698ab 100644 --- a/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts +++ b/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts @@ -88,7 +88,13 @@ export class JsonRulesEngineFactChecker techInsightChecks.forEach(techInsightCheck => { const rule = techInsightCheck.rule; rule.name = techInsightCheck.id; - engine.addRule({ ...techInsightCheck.rule, event: noopEvent }); + // Only run checks that have all the facts available: + const hasAllFacts = techInsightCheck.factIds.every( + retrieverId => !!facts[retrieverId], + ); + if (hasAllFacts) { + engine.addRule({ ...techInsightCheck.rule, event: noopEvent }); + } }); const factValues = Object.values(facts).reduce( (acc, it) => ({ ...acc, ...it.facts }),