[rules-users] Temporal operators for point-in-time events

Edson Tirelli ed.tirelli at gmail.com
Tue Dec 13 14:11:38 EST 2011


   Your use of the after operator is correct. The documentation tells you
about that, although in textual form:

http://docs.jboss.org/drools/release/5.3.0.Final/drools-fusion-docs/html_single/index.html#d0e611

   This presentation has the 2 tables of operators:

http://www.slideshare.net/ge0ffrey/applying-cep-drools-fusion-drools-jbpm-bootcamps-2011

    Edson

On Tue, Dec 13, 2011 at 12:11 PM, Mike Melton <mike.melton at gmail.com> wrote:

> Apologies for the stupid question, but I haven't seen anything in the
> documentation regarding this and I want to verify my solution. Say I
> have a point-in-time event (i.e., duration of 0) that I want to
> correlate to another point-in-time event. I want a rule that will
> activate if the timestamp of one is greater than or equal to the
> other, basically "after or coincides". I wrote a test using the
> following rule and it seemed to work:
>
> rule "Greater Than or Equal"
>  when
>    $e1 : TestEvent( $id : id )
>    $e2 : TestEvent( id != id, this after[0ms] $e1 )
>  then
>    System.out.println($e2 + " is greater than or equal to " + $e1);
> end
>
> I realize this rule will fire twice if the event timestamps are equal,
> but it's just for demonstration purposes; my question is specifically
> about the "after[0ms]" part. Is this the way to go to accomplish what
> I need? It seems so simple but I have this annoying feeling that I'm
> missing something.
>
> On a slightly related topic, is there an updated version of the
> temporal operators image from the Drools Fusion homepage? It is a
> great visual description of the operators and I want to print it out
> and post it at my desk, but it doesn't include all of the operators.
>
> Image:
> http://www.jboss.org/drools/drools-fusion/mainColumnParagraphs/02/imageBinary/temporal-operators.png
> >From page: http://www.jboss.org/drools/drools-fusion.html
>
> Thanks
> Mike
> _______________________________________________
> rules-users mailing list
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111213/10604c67/attachment.html 


More information about the rules-users mailing list