[rules-users] Fusion: Null pointer exception when using sliding windows

Wolfgang Laun wolfgang.laun at gmail.com
Fri Apr 19 23:48:51 EDT 2013


On 18/04/2013, burmanator <alexburman at gmail.com> wrote:
>
> rule test
> when
> $primary : Foo($name : Name) over window:length(24)
> $prev : ArrayList(size<1) from collect ( Foo(Name == $name, this before
> $primary))
> then
> System.out.println("Found name: " + $name);
> end
>

Apart from the sliding window and the manifest bug: I just wonder why
nobody has pointed out that the rule can be rewritten as:

rule test
when
    $primary : Foo($name : Name) over window:length(24)
    not Foo(Name == $name, this before $primary)
then
   System.out.println("Found name: " + $name);
end

There is no other way the list size can be less than 1 :-)
-W


More information about the rules-users mailing list