The result of rule excecution become incorrect or cause exception after more than 20 times excecusion

Solution Unverified - Updated -

Environment

  • Red Hat JBoss BPM suite (BPMS)
    • 6.x
  • Red Hat JBoss BRMS
    • 6.x

Issue

When String.compareTO() is used in constraint of decision table(XLS) like the following,

($1).compareTo($2) <= 0

the evaluation of this constraint becomes wrong on weblogic once jit compilation takes place after more than 20 times execution on WebLogic Server 12c.
If this rule run on EAP, the following warning is shown instead but evaluation of this constraint works as expected

00:22:45,267 WARN [org.drools.core.rule.constraint.MvelConstraint] (drools-worker-1) Exception jitting: (m.getStr1()).compareTo(m.getStr2()) <= 0 This is NOT an error and NOT prevent the correct execution since the constraint will be evaluated in intrepreted mode

Resolution

use the following constraint (i.e. without brackets for String object)

$1.compareTo($2) <= 0

Root Cause

Bug 1278059

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments