[rules-users] Consequence Exception with too many events

Jason Barto jason.p.barto at gmail.com
Fri May 3 20:56:17 EDT 2013


I am new to Drools (Expert and Fusion) and have been reading through the
materials over the last few days.  After going through some of the tutorial
code I wrote a very quick and dirty to perform a base assessment of the
speed of Fusion / Expert.  My code is below.  The strange thing I'm
currently receiving is, if I insert 100k events the test completes
successfully, if I insert 150k events, I receive a ConsequenceException
caused by an NPE.  Being new to Drools I must be doing something wrong, can
anyone please provide some guidance?

(Main function)
Counter cc = new Counter ();
session.insert (cc);
for (int i = 0; i < 150000; i++) {
  entryPoint01.insert (new MyEvent ());
}

(Counter Class)
public class Counter {
  private long total = 0;
  // get / set total
  public void addValue (int val) {
    total += val;
  }
}

(MyEvent Class)
public class MyEvent {
  private int value = 1;
  // get / set value
}

(DRL file)
declare MyEvent
  @role (event)
  @expires (1s)
end

rule "Count the rules"
when
  $ev : MyEvent () from entry-point entryPoint01
  $pc : Counter ()
then
  $cc.addValue ($ev.getValue ());
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130504/4b8e1dec/attachment.html 


More information about the rules-users mailing list