[jboss-jira] [JBoss JIRA] Created: (JBRULES-2719) Count in accumulate behaves incorrect in combination with update

Wouter Horré (JIRA) jira-events at lists.jboss.org
Fri Oct 1 11:24:40 EDT 2010


Count in accumulate behaves incorrect in combination with update
----------------------------------------------------------------

                 Key: JBRULES-2719
                 URL: https://jira.jboss.org/browse/JBRULES-2719
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 5.1.1.FINAL
            Reporter: Wouter Horré
            Assignee: Mark Proctor
         Attachments: count.zip

The following rule produces different results when update is used in contrast to when retract/insert is used (when a Container instance has changed):
rule "Count With Accumulate"
	when
		$l : Leaf();
		Number($nb: intValue) from accumulate($c : Container(leafs contains $l), count($c));
	then 
		System.out.println("Leaf " + $l.getName() + " with accumulate: " + $nb);
end

The following rule produces the correct result in both cases:
rule "Count With Collect"
	when
		$l : Leaf();
		HashSet($nb : size) from collect(Container(leafs contains $l));
	then 
		System.out.println("Leaf " + $l.getName() + " with collect: " + $nb);
end

I have attached a minimal example that triggers the behavior.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jboss-jira mailing list