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

Alex Burman alexburman at gmail.com
Tue Apr 16 12:09:39 EDT 2013


so I've now come up with:

$foo1 : Foo($status : Status)

not(Foo(Status == $status. this before $foo1))


$dupes : ArrayList (size>0) from collect ( Foo(Status == $status, this
coincides $foo1))

$fin : Foo() from $dupes

$foos : ArrayList (size>0) from collect ( Foo(Status != $status, this after
$fin))


However I am getting a ClassCastException:
org.drools.common.DefaultFactHandle cannot be cast to
org.drools.common.EventFactHandle  and I am not sure why. Does anyone have
any thoughts?


On Tue, Apr 16, 2013 at 12:31 AM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:

> 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
> >
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Sincerely,
Alex Burman
cell: 908-672-0198
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130416/243903ff/attachment.html 


More information about the rules-users mailing list