Exception in rule function doesn't bubble up with a constant message in BRMS

Solution Unverified - Updated -

Issue

  • I get different Exception messages in ksession level when a rule function hit an Exception.

Pattern A:

Caused by: [Error: DoDivide($frac.numerator, $frac.denominator): / by zero]
[Near : {... $frac.numericEquivalent=DoDivi ....}]
             ^
[Line: 1, Column: 1]
    at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:416)
    at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:143)
    at org.mvel2.ast.ASTNode.optimize(ASTNode.java:159)
    at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115)
    at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
    at org.mvel2.ast.DeepAssignmentNode.getReducedValueAccelerated(DeepAssignmentNode.java:92)
    at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
    at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113)
    at org.mvel2.MVEL.executeExpression(MVEL.java:930)
    at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:101)
    at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1204)

Pattern B:

Caused by: java.lang.RuntimeException: cannot invoke method: DoDivide
    at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)
    at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
    at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
    at org.mvel2.ast.DeepAssignmentNode.getReducedValueAccelerated(DeepAssignmentNode.java:92)
    at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
    at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
    at org.mvel2.MVEL.executeExpression(MVEL.java:930)
    at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:101)
    at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1204)

Environment

  • Red Hat JBoss BRMS
    • 5.3.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.