Search code examples
droolscomplex-event-processingdrools-fusion

Event sequencing


I'm new in Drools and CEP. I'm trying to solve issue by events processing - derive complex events from sequences of atomic events.

For example, the sequence of A, B and C atomic events is D complex event.

How can I solve this issue with Drools rule engine and Drools Fusion axtention? May be, there are other tools or Java frameworks (math methods or algorithms) to solve this kind of issues?


Solution

  • A rule to test for three events in a certain sequence:

    rule abc
    when
        $a: A()
        $b: B( this after $a )
        $c: C( this after $b )
    then
        // ...
    end
    

    There are many details to be clarified - in reality it may not be as simple as that, but your question doesn't provide any information.

    See the Drools manual - the section on event processing has similar (and more complex) examples.