[jboss-jira] [JBoss JIRA] (DROOLS-4469) Invalid result with collect, mvel and ForceEagerActivationOption.YES

Martin Weiler (Jira) issues at jboss.org
Sun Aug 25 15:11:00 EDT 2019


Martin Weiler created DROOLS-4469:
-------------------------------------

             Summary: Invalid result with collect, mvel and ForceEagerActivationOption.YES
                 Key: DROOLS-4469
                 URL: https://issues.jboss.org/browse/DROOLS-4469
             Project: Drools
          Issue Type: Bug
          Components: core engine
    Affects Versions: 7.25.0.Final
            Reporter: Martin Weiler
            Assignee: Mario Fusco


A rule updates a list in a fact:

{noformat}
rule "Init"
    dialect "mvel"
    when
        $fl: FactWithList(items.size()==0)
    then
        $fl.getItems().add("A");
        $fl.getItems().add("B");
        update($fl);
end
{noformat}

A second rule verifies if other facts exist, matching the items in the updated list:

{noformat}
rule "Expected Outcome"
    dialect "mvel"
    when
        $fl: FactWithList($itemList : items != null)
        $l: java.util.ArrayList(size > 0) from collect(FactWithString($itemList contains stringValue));
    then
        System.out.println("--> Rule: " + kcontext.getRule().getName() + " fired, " + $fl + ", collect list: " + $l.size());
end
{noformat}

This rule is *not* fired if 
* mvel dialect is used *and*
* Drools is executed with {{ForceEagerActivationOption.YES}} (jBPM use case)

Note: This worked in 7.17 and earlier!



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list