// uses global variable conversation static void ctxProcessRule(S ruleName) { if (ruleName == null) ret; ++ctxContext().safetyCounter; WoodyRule rule = bot.getRule(ruleName); printObjectWithFields(rule, "fullName", "condition", "body", "properties"); // fake if (eqic(ruleName, "Agent#EVENT.NEWUSER")) { S theGoto = ctxFindFirstGoto(rule.body); print("NEWUSER -> Goto: " + theGoto); ctxContext().nextRule = theGoto; ret; } if (ctxDoNextActionInRule(rule)) ret; SS cases = ctxCaseGotos(rule.body); if (nempty(cases)) { S matched = null, nextRule = null; for (S cond, target : cases) { Bool b = ctxEvalCondition(cond); print(cond + " -> " + b); if (isTrue(b) && nextRule == null) { matched = cond; nextRule = target; } } ctxContext().nextRule = nextRule; // may be null if (matched != null) ret; } print("Unknown rule type"); }