[rules-users] Declaring events programmatically

Samuli Saarinen samuli.saarinen at remion.com
Tue Oct 26 03:33:52 EDT 2010


OK, just wanted to make sure.

Is my understanding correct that if I want to use temporal constraints 
in some rules I can declare a fact as an event but I can still use it as 
a plain fact in other rules? From what I understand after reading the 
documentation is that the event declaration applies to the whole 
knowledge base?

Cheers,

Samuli


On 26.10.2010 10:14, Wolfgang Laun wrote:
> This only makes sense if your rules use constraints with temporal operators,
> so you'll have to know at "rule writing time". So, I don't quite see why
> you'd
> want or need to do that.
>
> The information from a declare is stored by the compiler; this API (even if
> exposed) would not help you, as you'd have to access it during the
> compilation,
> or do all that what needs to be done while compiling a declare. Creating a
> text and compiling this as a .DRL is much simpler.
>
> -W
>
> On 26 October 2010 09:07, Samuli Saarinen <samuli.saarinen at remion.com
> <mailto:samuli.saarinen at remion.com>> wrote:
>
>     Hi,
>
>     I'm aware of that but was looking for a way to do it using some API. I
>     am inserting some objects to the engine and would like to declare them
>     as events "automatically" before inserting. I could generate the snippet
>     shown in the doc and add it to the knowledge base but was wondering if
>     the same thing could be accomplished using existing API.
>
>     Cheers,
>
>     Samuli
>
>     On 26.10.2010 9:51, Greg Barton wrote:
>      >
>     http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-fusion/html/ch02.html#d0e241
>      >
>      > Use type declaration and @role(event)
>      >
>      > --- On Tue, 10/26/10, Samuli Saarinen<samuli.saarinen at remion.com
>     <mailto:samuli.saarinen at remion.com>>  wrote:
>      >>
>      >> I'm looking for a way to declare facts as events using an
>      >> API. Would
>      >> anyone happen to know if such an API exists in drools?
>      >>
>      >> Cheers,
>      >>
>      >> Samuli
>
>
>
>
>     --
>     Remion Oy           Etävalvontajärjestelmät liiketoiminnan
>     Samuli Saarinen           tehostamiseen
>     gsm +358 (0)50 3560075
>     fax +358 (0)3 2125064 www.remion.com <http://www.remion.com>
>     _______________________________________________
>     rules-users mailing list
>     rules-users at lists.jboss.org <mailto: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



-- 
Remion Oy           Etävalvontajärjestelmät liiketoiminnan
Samuli Saarinen           tehostamiseen
gsm +358 (0)50 3560075
fax +358 (0)3 2125064       www.remion.com



More information about the rules-users mailing list