Hi Edson,
I dig this a little deeper and found out that event declaration in
separate file works correctly if file declaring the event and file
containing a rule using the event have the same package. Is there a
reason it should work only within the same package or should I open a JIRA?
Cheers,
Samuli
On 29.10.2010 19:11, Edson Tirelli wrote:
Samuli,
Are you adding your event declaration file before the rules that
use them? As of today, you must always do that, but as long as you do,
it should work even if they are in separate files.
Regarding the update, it is not possible to do that today, but feel
free to open a JIRA. I think it is something we should do.
Edson
2010/10/29 Samuli Saarinen<samuli.saarinen(a)remion.com>:
> Hello,
>
> I have the following situation with Drools 5.1.1: 2 drl files where one
> contains an event declaration:
>
> declare Event1
> @role(event)
> @expires(1s)
> end
>
> and other has a simple rule:
>
> rule "Evt1"
> when
> e: Event1(value == 10)
> then
> System.out.println(e);
> end
>
> And I have the following test which fails:
>
> ses.insert(new Event1(1));
> ses.fireAllRules();
> clock.advanceTime(2, TimeUnit.SECONDS);
> ses.fireAllRules();
> assertEquals(ses.getFactCount(), 0L);
>
>
> The same test passes if the rule and event declaration are on the same
> drl file.
>
> Further more if I declare the event in both of the files with different
> @expires the one being used is the one that is added first. I was hoping
> that the first declaration to be a "default expires" that could be
> overwritten later on with a new declaration but it seems that this is
> currently not possible.
>
> Cheers,
> Samuli
--
Remion Oy Etävalvontajärjestelmät liiketoiminnan
Samuli Saarinen tehostamiseen
gsm +358 (0)50 3560075
fax +358 (0)3 2125064
www.remion.com