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-t...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)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/>