[rules-users] retracting a fact after all interested rules have fired??
Michael Neale
michael.neale at gmail.com
Tue Feb 13 00:01:52 EST 2007
the salience can work fine, or else you can use "agenda-groups" and then
something like:
workingMemory.fireAllRules();
workingMemory.setFocus("cleanup");
workingMemory.fireAllRules();
On 2/8/07, Justine Hlista <justine at vsasset.com> wrote:
>
> Need some instruction for retraction strategies. We have an application
> that receives messages about the status of various things in the system, and
> at the moment I am asserting these messages as facts. The rules are written
> against these messages. Various rules might be interested in various values
> in the message, and they all fire independently. The problem is that after
> all the existing rules that are interested in the message have fired, I want
> to retract the message. How do I ensure that all the interested rules have
> fired first??
>
> At the moment, I am trying to use a salience value of -1 to make sure a
> simple "cleanup" rule fires last:
>
> rule "cleanupMessage"
> no-loop true
> salience -1
> when
> msg : MyMessage()
> then
> retract(msg)
> end
>
> Does this sound like a reasonable solution? Is there a better one??
>
> Thanks!
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070213/2e535b10/attachment.html
More information about the rules-users
mailing list