Barry,

   I did not run the code bellow, but drools uses the temporal distance algorithm to calculate how much time it has to wait on a "delaying not" before activating the rule. So, the first question I have is what are you using as timestamp for the events? the time they are inserted into the engine or a timestamp attribute?

   []s
   Edson

  

2009/8/30 Barry Kaplan <groups1@memelet.com>

After looking at ../integrationtests/test_CEP_DelayingNot.drl I'm getting
closer, but not really understanding. I can get a greenbar with the below.
However if change the last advanceTime() value to anything less than 30 the
test fails. So it seems that the the conditional not clause does not start
its window until the first two clauses are true.

Why would this be? Why does it not start ticking when the first StartEvent
is inserted?

----
rule "[every s->f&&!a] How do I use patterns to correlate events arriving
in-order or out-of-order?"
when
       $se : StartEvent($exchangeId : exchangeId)
               from entry-point "stream"

       $fe : FinishedEvent(exchangeId == $exchangeId, this after[0s,30s] $se)
               from entry-point "stream"

       not (AbortedEvent(exchangeId == $exchangeId, this after[0s,30s] $se)
               from entry-point "stream")
then
       results.put("startEvent", $se);
       results.put("finishedEvent", $fe);
end
----
       @Test
       def void
How_do_I_use_patterns_to_correlate_events_arriving_in_order_or_out_of_order__B()
{
               insert new StartEvent(id: "se1", exchangeId: "BBB")
               advanceTime 10, SECONDS
               fireAllRules()
               assert results.isEmpty()

               advanceTime 10, SECONDS
               insert new FinishedEvent(id: "fe1", exchangeId: "BBB")
               fireAllRules()
               assert results.isEmpty()

               advanceTime 30, SECONDS
               assert results["startEvent"].id == "se1"
               assert results["finishedEvent"].id == "fe1"
       }
----
--
View this message in context: http://www.nabble.com/Conditional-%27not%27-invalid-for-event-streams--tp25217095p25217673.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com