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
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);
}
EndThanks,
Ashfaq
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users