[rules-users] Consequence Exception with too many events

Wolfgang Laun wolfgang.laun at gmail.com
Sat May 4 02:58:23 EDT 2013


Works for me (5.5.0, 5.4.0) - at least based on the code you've posted
which (apart from the omitted getters and setters) isn't the one you've
been running, and so you may have changed or omitted something
that's essential.

The full stack dump might shed some more light on this, and the full and
true code of the rule RHS whre the NPE is caused.

-W

On 04/05/2013, Jason Barto <jason.p.barto at gmail.com> wrote:
> 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
>


More information about the rules-users mailing list