On 04/08/2010 09:34, Wolfgang Laun wrote:
The enum type defines three values as indication for an activation's cancellation.
WME_MODIFY, FILTER and CLEAR. Since I was missing something, I looked
and found that CLEAR is used for two very much different reasons:
- due to Agenda.clear()
- when deleting a rule.
Filter is the result of the agenda-filter causing the activation to cancel:
                        if ( filter == null || filter.accept( item ) ) {
                            // fire it
                            fireActivation( item );
                            result = true;
                        } else {
                            // otherwise cancel it and try the next
                            final EventSupport eventsupport = (EventSupport) this.workingMemory;

                            eventsupport.getAgendaEventSupport().fireActivationCancelled( item,
                                                                                          this.workingMemory,
                                                                                          ActivationCancelledCause.FILTER );
                            tryagain = true;
                        }

WME_MODIFY is the result of any wme action that causes an activation to be cancelled.

CLEAR is the result of a forced cancellation of an activation, either be explicitely calling clear or removing a rule.

I agree we could probably split that out and have a KB_MODIFY, so that if the activation is cancelled as a result the rule being removed we get a different event.

Mark

Is this intentional?

-W

_______________________________________________ rules-dev mailing list rules-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev