Search in sources :

Example 1 with JavaAnalysisResult

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());
}
Also used : JavaAnalysisResult(org.drools.compiler.rule.builder.dialect.java.JavaAnalysisResult) Declaration(org.drools.core.rule.Declaration)

Aggregations

JavaAnalysisResult (org.drools.compiler.rule.builder.dialect.java.JavaAnalysisResult)1 Declaration (org.drools.core.rule.Declaration)1