use of org.drools.compiler.rule.builder.dialect.java.JavaAnalysisResult in project drools by kiegroup.
the class AbstractASMConsequenceBuilder method consequenceContext.
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 = KnowledgeHelperFixer.fix(DialectUtil.fixBlockDescr(context, analysis, decls));
return JavaRuleBuilderHelper.createConsequenceContext(context, consequenceName, className, fixedConsequence, decls, analysis.getBoundIdentifiers());
}
Aggregations