}
private Map<String, Object> consequenceContext(RuleBuildContext context, String consequenceName) {
String className = consequenceName + "Consequence";
Map<String, Declaration> decls = context.getDeclarationResolver().getDeclarations(context.getRule(), consequenceName);
JavaAnalysisResult analysis = JavaRuleBuilderHelper.createJavaAnalysisResult(context, consequenceName, decls);
if ( analysis == null ) {
// not possible to get the analysis results
return null;
}
// this will fix modify, retract, insert, update, entrypoints and channels
String fixedConsequence = DialectUtil.fixBlockDescr(context, analysis, decls);
if ( fixedConsequence == null ) {
// not possible to rewrite the modify blocks
return null;
}
fixedConsequence = KnowledgeHelperFixer.fix(fixedConsequence);
return JavaRuleBuilderHelper.createConsequenceContext(context, consequenceName, className, fixedConsequence, decls, analysis.getBoundIdentifiers());
}