static S ctxFindRuleForInput() { WoodyRule activeRule = bot().getRule(ctxContext().activeRule); WoodyBot bot = woodyBot(); if (activeRule != null) { print("Active rule: " + activeRule.ruleName); WoodyRule analyzer = bot.getRule(activeRule.properties.get("ANALYZER")); print("Analyzer: " + getOpt(analyzer, "ruleName")); if (analyzer != null) { // TODO } try answer ctxFindRuleForInput_default(); ret activeRule; } ret ctxFindRuleForInput_default(); } sS ctxFindRuleForInput_default() { for (WoodyRule rule : woodyOnRules(woodyBot())) if (rule.parsedCondition != null && rule.parsedCondition.get()) { print("Matching: " + rule.fullName + " " + structForUser(rule.properties)); printIndent(struct(rule.body)); // Just return first matching rule for now ret rule.fullName; } null; }