[rules-users] Get previous fact from working memory.

Vincent Legendre vincent.legendre at eurodecision.com
Thu Oct 6 13:32:12 EDT 2011


Hum, rigth ...
You want the last to be false ?

may be something like that (ignore the type first to get the last, then 
test it in a eval)

rule "check_agains_last"
when
      $e1 : Event (eventType == Event.EventType.EVENT1)
      $e2 : Event (this before $e1)
      not Event (this after $e2)
*      eval ($e2.getEventType() == Event.EventType.EVENT2)*
then
     ...
end


But to me this rule is too complex according to what it tells ... You 
should implement the chaining via the listener.



Le 06/10/2011 19:09, tungl a écrit :
> Thanks Vincent, but when I do it like this:
>
>
> It's sufficient that EVENT2 has happened anywhere before EVENT1.
>
> So EVENT1, EVENT2 =>  false, false
> EVENT2, EVENT1 =>  false, true (that's right, but:)
> EVENT2, EVENT1, EVENT1 =>  false, true, true (?)
>
> How do I fix that?
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Get-previous-fact-from-working-memory-tp3399064p3400371.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


-- 
Vincent LEGENDRE
/Consultant Sénior/

EURODECISION
9A rue de la Porte de Buc 78000 VERSAILLES
Tél. : +33 (0)1 39 07 12 40
Direct : +33 (0)1 39 07 26 16
www.eurodecision.com
EURODECISION <http://www.eurodecision.com/><http://www.eurodecision.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111006/06f22f51/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logoED.gif
Type: image/gif
Size: 3345 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20111006/06f22f51/attachment.gif 


More information about the rules-users mailing list