Warning: session_start(): open(/var/lib/php/sessions/sess_7p3l76cctr762hpcn2642v1usc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
scope dm_gazelle_statementsFromAppliedRules.
sclass #ByRule {
S ruleID;
new TreeSet statements;
}
static LS dm_gazelle_statementsFromAppliedRules() {
L concepts = cloneList((L) dm_requireAndCall("#1021413/AppliedRules", 'concepts));
print("Got " + n2(concepts, "concept"));
new Map ruleMap;
for (O c : concepts) pcall {
S judgement = getString judgement(c);
S struct = getString matchedRuleStruct(c);
O matchedRule = safeUnstruct(struct); // RuleEngine2_MatchedRule
O rule = getOpt rule(matchedRule);
S ruleID = getString globalID(rule);
S ruleIn = first((LS) get in(rule));
//print(judgement + " : " + shorten(40, struct));
SS varMap = getOpt map(matchedRule);
S tokenize = getString tokenizationFunction(matchedRule);
LS tok = cast callAndMake(tokenize, ruleIn);
LS tokC = codeTokens(tok);
Set possibleVars = asCISet(tokC);
//print(" Cached: " + getOpt_cache.get(_getClass(matchedRule)));
//print(" fieldValues:" + keys(data/DynamicObject.fieldValues));
//print(" Var-Map: " + varMap);
//print(" Rule-ID: " + ruleID);
ByRule r = getOrCreate_f1(ruleMap, ruleID, func(S ruleID) -> ByRule { nu(ByRule, +ruleID) });
for (S a, b : varMap) {
r.statements.add(format("in a * mapping, variable " + quote(a) + " was used", judgement));
r.statements.add(format("in a * mapping, variable " + quote(a) + " was mapped to " + quote(b), judgement));
}
for (S var : possibleVars)
r.statements.add("possible variable " + quote(var));
}
pnlStruct(values(ruleMap));
new LS out;
for (ByRule r : values(ruleMap))
for (S s : r.statements)
out.add("Rule " + r.ruleID + ": " + s);
ret out;
}
end scope