I think something like this should work:
rule "raise alarm"
when
Event($type : eventType)
exists (ArrayList (size > 10)
from collect (Event(eventType == $type)))
then
raise alarm
Of course that you can't use the $events anymore. You can use a flag too:
rule "raise alarm"
when
not TheAlarmWasAlreadyTriggered()
Event($type : eventType)
$events: ArrayList (size > 10)
from collect (Event(eventType == $type))
then
raise alarm
insert(new TheAlarmWasAlreadyTriggered());
best,
2010/3/15 Amit Kumar <amitkumar(a)gmail.com>
Hello All,
Was doing some rule writing and am seeing some issues which I want to
overcome.
In Fusion when we send the facts into working memory.. there seems to be no
way that rules are automatically getting triggered.
We have to call fireAllRules after each fact insertion. Is this the way it
was designed. Its like this in the stocktick example also
This one should be simple for somebody with little more experience than me
In the following rule
rule "raise alarm"
when
Event($type : eventType)
$events: ArrayList (size > 10)
from collect (Event(eventType == $type))
then
raise alarm
In the above rule the raise alarm is getting called 10 times. .. How can I
make it to be called only once.
Thanks
Amit
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti