[rules-users] Basic doubt regarding Drools Fusion - @expires

Makewise - Vitor Rui Mendonça Vitor.Mendonca at brisa.pt
Thu Mar 17 07:19:59 EDT 2011


Edison, first of all, thanks for your quick reply!

Those initial words caught my attention, although: “By default, Drools does not start any internal thread”…

What do you mean “by default”?
I know there are ways to force the event to be expired but I’m looking for a solution that doesn’t involve to write new rules.

For example, I’m using this kind of solution:

declare A

      @role( event )

      @expires( 1h )

end
rule "internal - expiring A"
      timer(int:1h)
when
      $a : A() from entry-point "incoming"
then
      retract($a);
end

Although this solution works (from Drools 5.1), I’m forced to write a rule to expire an event that’s supposed to be expired initially.
There’s a simpler way to do this? I’m thinking correctly?

Once again, thanks!



Vítor Mendonça Moreira
Analista / Programador
Direcção de Investigação e Desenvolvimento

Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq.
2500 - 206 - Caldas da Rainha
Tel: (+351) 262 832 196
Fax: (+351) 262 186 455
Web: www.makewise.pt<http://www.makewise.pt>
Uma empresa: Grupo Sousa Pedro<http://www.sousapedro.com>

[cid:image002.jpg at 01CBE493.E9E167A0]





________________________________

Declaração:
A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos.Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu computador,sem os reproduzir.

Disclaimer:
The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses.If you are not the intended recipient (or the person responsible for delivering to the intended recipient) and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this message and the files attached, without retaining a copy.
________________________________
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Edson Tirelli
Sent: quarta-feira, 16 de Março de 2011 18:38
To: Rules Users List
Subject: Re: [rules-users] Basic doubt regarding Drools Fusion - @expires


   By default, Drools does not start any internal thread, so that you can embed it in non-multithread applications or in JEE containers. That means that the actual release of events in such cases depends on triggers. In your example, after 1h has passed, whenever something happens to the session (a new rule is fired, a new event is inserted, the session clock is advanced, etc), the event will be expired as part of the action. Remember though that it only happens when running in STREAM mode. In CLOUD mode, event garbage collection does not make sense and will not happen.

  Edson
2011/3/16 Makewise - Vitor Rui Mendonça <Vitor.Mendonca at brisa.pt<mailto:Vitor.Mendonca at brisa.pt>>
Hi all!

I’ve got a really basic doubt… I’ve read several documentation regarding it but I think I need some advice here…

Imagine that I have an event:
declare A
      @role( event )
      @expires( 1h )
end

On my Java code, I call “fireAllRules()” method every time that I put an event into the working memory.

My doubt: When does event A expires?

a)      One hour after it was inserted (time-based and without the “fireAllRules()” method call) or

b)      by calling “fireAllRules()” method (event-based)

T.I.A.



Vítor Mendonça Moreira
Analista / Programador
Direcção de Investigação e Desenvolvimento

Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq.
2500 - 206 - Caldas da Rainha
Tel: (+351) 262 832 196
Fax: (+351) 262 186 455
Web: www.makewise.pt<http://www.makewise.pt>
Uma empresa: Grupo Sousa Pedro<http://www.sousapedro.com>

[cid:image002.jpg at 01CBE493.E9E167A0]




________________________________

Declaração:
A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos.Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu computador,sem os reproduzir.

Disclaimer:
The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses.If you are not the intended recipient (or the person responsible for delivering to the intended recipient) and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this message and the files attached, without retaining a copy.
________________________________

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users



--
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com<http://www.jboss.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110317/4bca1d3c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 635 bytes
Desc: image001.jpg
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110317/4bca1d3c/attachment.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 2725 bytes
Desc: image002.jpg
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110317/4bca1d3c/attachment-0001.jpg 


More information about the rules-users mailing list