Search in sources :

Example 1 with MvelCompilerException

use of org.drools.mvelcompiler.MvelCompilerException in project drools by kiegroup.

the class Consequence method createExecuteCallMvel.

private MethodCallExpr createExecuteCallMvel(String consequenceString, BlockStmt ruleVariablesBlock, Set<String> usedDeclarationInRHS, MethodCallExpr onCall) {
    String mvelBlock = addCurlyBracesToBlock(consequenceString);
    CompiledBlockResult compile;
    try {
        compile = DrlxParseUtil.createMvelCompiler(context).compileStatement(mvelBlock);
    } catch (MvelCompilerException e) {
        context.addCompilationError(new CompilationProblemErrorResult(new MvelCompilationError(e)));
        return null;
    }
    replaceKcontext(compile.statementResults());
    rewriteChannels(compile.statementResults());
    return executeCall(ruleVariablesBlock, compile.statementResults(), usedDeclarationInRHS, onCall, compile.getUsedBindings());
}
Also used : MvelCompilationError(org.drools.modelcompiler.builder.errors.MvelCompilationError) CompilationProblemErrorResult(org.drools.modelcompiler.builder.errors.CompilationProblemErrorResult) MvelCompilerException(org.drools.mvelcompiler.MvelCompilerException) CompiledBlockResult(org.drools.mvelcompiler.CompiledBlockResult)

Aggregations

CompilationProblemErrorResult (org.drools.modelcompiler.builder.errors.CompilationProblemErrorResult)1 MvelCompilationError (org.drools.modelcompiler.builder.errors.MvelCompilationError)1 CompiledBlockResult (org.drools.mvelcompiler.CompiledBlockResult)1 MvelCompilerException (org.drools.mvelcompiler.MvelCompilerException)1