ClassCastException in mvel when updating a List property with modify

Solution In Progress - Updated -

Issue

Rules that used "modify" that worked perfectly in BPM Suite 6.4 fail in RHPAM 7.4

We are upgrading from JBoss BPMS 6.4.11 to RHPAM 7.4.0. We have run the migration script and most of our rules work fine.

However we are unable to execute rules with the following pattern:

rule "Update address list"
    dialect "mvel"
    when
                $p : Person()
                not(Address(street=="Main Street") from $p.addresses)
    then
                Address address = new Address("Main Street")
                modify($p) { addresses.add(address) }

Error:

Exception executing consequence for rule "Update address list" in defaultpkg: java.lang.ClassCastException: org.mvel2.optimizers.impl.refl.nodes.GetterAccessor cannot be cast to org.mvel2.optimizers.impl.refl.nodes.MethodAccessor
    at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
    at org.drools.core.common.DefaultAgenda.handleException(DefaultAgenda.java:1242)
    at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:439)
    at org.drools.core.phreak.RuleExecutor.fireActivation(RuleExecutor.java:380)
    at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:136)
    at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:89)
    at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34)
    at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
    at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1062)
    at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1009)
    at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1001)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1330)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1321)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1305)
    at org.drools.compiler.integrationtests.Misc2Test.testModifyAddToList(Misc2Test.java:9139)

Environment

  • Red Hat Process Automation Manager (RHPAM)
    • 7.x
  • Red Hat Decision Manager (RHDM)
    • 7.x

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