[rules-users] Event streams

Chris Richmond crichmond at referentia.com
Fri Sep 25 16:17:52 EDT 2009


It is my understanding that an event will be detected as soon as it is
inserted into a stream.meaning that I don't have to explicitly call
fireRules in order to evaluate events, but them will be evaluated as soon as
I insert them into a stream, so a rule like the one below would fire as soon
as I perform  datastream.insert(myDataStreamObject) without having to
explicitly fire rules? Is that behavior correct/intended?

 

 

Declare MyDataStreamObject

            @role(event)

End

 

 

//rule "detect a stream data object"

 

When

            MyDataStreamObject() from entry point "DATA"

Then

            System.err.println("data object inserted");

end

 

 

 

 

Also, could I generate another event(long lived.say it lives 1 minute) so
that if the above event detector fired and some condition was  met, I could
have it fire some event within the rule engine? Something like the
following:

 

 

//rule "detect a stream data object"

 

When

            MyDataStreamObject($val: fieldValue < 20) from entry point
"DATA"

Then

            //I want to raise an event purely from this rule that will live
for one minute or so, that I can use to further refine this rule, to make
sure this rule makes

            //sure that the MyDataStreamObject event "NOT INCLUDED" within
the generated longer lived event lifetime. Efffectively preventing me from
firing this if one of my

            //generated events is still living

end

 

 

Thanks,


Chris

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090925/a54838da/attachment.html 


More information about the rules-users mailing list