hi James,
you can access the context hash directly from a Perl
miniprogram, but there are better ways to achieve your
goal. For example, you can maintain the number of
events in each context in a separate hash (here is the
ruleset sketch for doing this):
type=single
ptype=regexp
pattern=add (\S+)
desc=add an event to $1
action=add $1 event; eval %o ( ++$hash{$1}; )
type=single
ptype=regexp
pattern=size (\S+)
desc=find the number of events in $1
action=eval %n ( $hash{$1} )
Note that you can use the Perl hash (%hash) not only
action lists, but also in context expressions and
patterns (of PerlFunc type). This should give you a
wide variety of options to use context sizes in
different arithmetic expressions and conditions. Also,
it is recommended to delete the hash table entry (eval
%o ( delete $hash{$1}; ) ) when the corresponding
context is deleted or expires.
hth,
risto
> Does anyone know if the context hash is exposed such
> that I can write
> a perl mini-program as a context parameter to
> accomplish what is
> described below?
>
> -James
>
> On 4/5/08, James Crawford <[EMAIL PROTECTED]>
> wrote:
> > How to evaluate if a context has n number of
> events in it's store?
> >
> > Example:
> >
> > ...
> > context=!BLAH
> > action=create BLAH; add BLAH $0
> >
> > ...
> > context=BLAH
> > action=add BLAH $0
> >
> > How can I check that BLAH has had 5 events added
> to it? I want to be
> > able to add an action to a context, but only after
> n number of events
> > have been added to it's store.
> >
> > Thanks in advance,
> >
> > -James
> >
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008
> JavaOne(SM) Conference
> Register now and save $200. Hurry, offer ends at
> 11:59 p.m.,
> Monday, April 7! Use priority code J8TLD2.
>
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Simple-evcorr-users mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
>
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total
Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Register now and save $200. Hurry, offer ends at 11:59 p.m.,
Monday, April 7! Use priority code J8TLD2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users