[rules-users] Insert, fire, then retract from consequence

Wolfgang Laun wolfgang.laun at gmail.com
Fri Sep 20 13:39:45 EDT 2013


On 20/09/2013, Jonathan Knehr <jonathan.knehr at gmail.com> wrote:
> I am wondering if I can insert a fact, fire all activated rules, then
> retract the fact all in a rules consequence.

Certainly. But the fireAllRules() would have to address a session
different from the one that's executing the consequence.

>
> I have similar behavior using the API that I'd like to be able to do inside
> a rule, as well.

A consequence is just Java,  so go ahead.

>
> The idea is that once all the rules that cause activations get fired, it
> gets retracted immediately. This is so that we don't have to have cleanup
> rules all over the place, and have to ensure that the salience is set
> correctly.

Is "it" a fact? You can retract it from the place where it was
inserted, for instance. Well-designed rule sets don't have "cleanup
rules all over the place". And salience is a last resort, not a
first-class way of designing rule sets.

>
> Any ideas?
>
> Thanks in advance!
>
> Sent from my iPhone

Looks like it.

-W


> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list