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(a)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(a)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(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference