[rules-users] Drools Fusion: Finding an event that occuring after an event but not before it

Wolfgang Laun wolfgang.laun at gmail.com
Tue Apr 16 00:31:00 EDT 2013


If there is no other attribute that distinguishes between the two
Foo objects at the same time and with the same status, then the
theory says that there is just one fact/event and you just happen
to have the data duplicated. Getting rid of the duplicate may be
one way of solving your problem.

Another approach would be to create a marker fact saying that you've
dealt with a Foo at a certain time, and check for its absence, both in
the rule you've (almost) shown.

-W

On 16/04/2013, burmanator <alexburman at gmail.com> wrote:
> I am trying to track when an event object Foo with a distinguishing
> identifier of Status.
> I want to try and identify a list of events when a Foo event with Status 2
> happens after an event with Status 1 but at the same time a Status 1 has
> not
> happened before.
>
> fight now I've come up with:
>
> $foo1 : Foo($status : Status)
>
> not(Foo(Status == $status. this before $foo1))
>
> $foos : ArrayList (size>0) from collect ( Foo(Status != $status, this after
> $foo1))
>
> Part of the problem I am having, is that a Foo event with the same Status
> can happen at the same timestamp. How do I get it to work so the rule only
> triggers once for multiple events on the same timestamp?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Fusion-Finding-an-event-that-occuring-after-an-event-but-not-before-it-tp4023352.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
>


More information about the rules-users mailing list