use of org.drools.core.common.MissingDependencyException 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
try {
String fixedConsequence = KnowledgeHelperFixer.fix(AsmUtil.fixBlockDescr(context, analysis, decls));
return JavaRuleBuilderHelper.createConsequenceContext(context, consequenceName, className, fixedConsequence, decls, analysis.getBoundIdentifiers());
} catch (MissingDependencyException e) {
context.addError(new MissingDependencyError(context.getRuleDescr().getResource(), e));
}
return null;
}
Aggregations