[rules-users] Correlation of events

Steven Williams stevenw at objectconsulting.com.au
Wed Feb 28 06:10:54 EST 2007


I think you may want to use a global here:

global ErrorMetaData errorMetadata;

rule "new error"
        when
                $error : Error (state == NEW_ERROR)
        then
                (search workingmemory if this error was already registered)
                if (found)
                {
                        errorMetadata.setLastTimestamp(currentTimestamp)
                        retract($error);
                }
end


On 2/28/07, Framewala, Ashfaq Y <Ashfaq.Framewala at gs.com> wrote:
>
>  Hi,
>
> I am working on a system where I need to correlate few error conditions
> happening in the network infrastructure. I have gone through the
> documentation for Jboss rules engine (Drools) and I am planning to use it
> for the correlation purpose.
>
> Can anyone let me know a way in which I can get an object from
> workingmemory in the "then" part of the rule? For e.g., I need the
> following
>
> rule "new error"
>         when
>                 $error : Error (state == NEW_ERROR)
>         then
>                 (search workingmemory if this error was already
> registered)
>                 if (found)
>                 {
>
> $errFromWorkingMemory.setLastTimestamp(currentTimestamp)
>                         retract($error);
>                 }
> End
>
> Thanks,
> Ashfaq
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw at objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070228/1d42865d/attachment.html 


More information about the rules-users mailing list