[rules-users] Help needed in activationCreated and activationCanceled event

Michael Anstis michael.anstis at gmail.com
Thu Nov 4 10:56:36 EDT 2010


Please don't email me direct. I won't reply in the future. All questions and
answers are of value to the community as a whole.

To quote what I replied to an almost identical request a couple of days ago
and posted to the drools-user mailing list.....

"AFAIK, Activation Cancelled events would trigger in reaction to the
revocation of a logically inserted fact that caused an activation to trigger
in the first place. It would not help identifying which pattern in a rule
was not matched causing your rule not to activate".

On 4 November 2010 14:41, <nkumar at objectwave.com> wrote:

> Hi, thanks for helping me out with that code. i have one more question, in
> activation cancelled event, it never gets executed.
>
> @Override
>                public void activationCancelled(ActivationCancelledEvent
> event) {
>                        final Rule rule = event.getActivation().getRule();
>                        final String ruleName = rule.getName();
>                        System.out.println("Activation cancelled --> " +
> ruleName);
>                        rules.add(rule);
>                        ruleNames.add(ruleName);
>                }
>
>
> @Override
>                public void activationCreated(ActivationCreatedEvent event)
> {
>                        final Rule rule = event.getActivation().getRule();
>                        final String ruleName = rule.getName();
>                        System.out.println("Activation created --> " +
> ruleName);
>                        rules.remove(rule);
>                        ruleNames.remove(ruleName);
>                }
>
>
> but my output never show this. i only have Activation created printed in
> console. which rule is not executed, that is not printing at the time when
> it is not activated. Please have a look on this.  My output is
>
> Rules not executed
> - GoodBye-rule
> - Hello World-rule
> - Never fires
> Activation created --> Hello World-rule
> Hello World
> Activation created --> GoodBye-rule
> Goodbye cruel world
> Rules not executed
> - Never fires
>
>
> this is the same code which you sent me. Never fires is the rule which
> never gets executed. we print this from the list of rules we have when we
> load the rule file. even if i skip that activation canceled it prints the
> same result.
>
>
> thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101104/3dfc3f19/attachment.html 


More information about the rules-users mailing list