-1

Could someone please help me with this accumulate function accumulate

($sum: Repetition(objectId == getEventKey(), "VERY_LONG".equals(getRepType())); 
  $count: count($sum); $count== $vlongCount)

though the $count=10 and vlongcount=11 accumulate is still happening. is there any bug associted with accumulate function in Drools

pinegulf
  • 1,334
  • 13
  • 32
veena rao
  • 1
  • 3
  • 1
    From what you have posted I cannot even try to guess your intention. Add the Java code for class `Repetition`, the complete rule text and how you insert facts. Don't forget to state the Drools version number. – laune Nov 23 '17 at 09:07
  • hi the drools version is 6.0.3. – veena rao Nov 23 '17 at 09:10
  • Hi the drools version is 6.0.3 ..From Repetiton class im trying to accumulate some data based on some conditions. so im counting the $sum variable.. then trying to compare with Vlongcount that was recieved before. – veena rao Nov 23 '17 at 09:17
  • here is the rule rule "abc" when $rep: Repetition(eventId:getEventID(),,$shtcnt: Integer.valueOf(((ALA)getObject()).getALACOUNT()),"VERY_LONG_REP".equals(getRepType())) accumulate($sum: Repetition(objectId == getEventKey(), "VERY_LONG".equals(getRepType()));$count: count($sum); $count== $vlongCount) then – veena rao Nov 23 '17 at 09:17
  • class Repetition { public String eventID; private String eventKey; Object object; private String repType; public String getEventID() { return eventID; } public String getEventKey() { return eventKey; } public Object getObject() { return object; } public String getRepType() { return repType; } } – veena rao Nov 23 '17 at 09:23
  • No. Please edit your question. Comments aren't intended for posting code. If the full rule code refers to classes other than `Repetition` (ALA??) you should posts these, too. Thank you. – laune Nov 23 '17 at 12:26

1 Answers1

0
$count:Number(intValue == $vlongCount)
from accumulate(Repetition($sum: objectId == getEventKey(), "VERY_LONG".equals(getRepType())),$count: count($sum))
Yousra ADDALI
  • 332
  • 1
  • 3
  • 14