[rules-users] Get the reason why certain rule failed to be activated.

Wolfgang Laun wolfgang.laun at gmail.com
Tue Apr 21 09:35:19 EDT 2009


You're asking for the Moon, and some stars thrown in.

Consider the general case, where there isn't just one simple constraint
condition - any of those could fail. The Rete network would have to be
extended enormously to create the NAKtivations you're asking for.

Try it for yourself and write the rules with negated conditions, e.g.,

rule "not rule1"
  when
   $p : Person($name : name not matches "gogo")
  then
    System.out.println( $name + " is not a gogo" );
End

-W


2009/4/21 Meny Kobel <meny.kobel at gmail.com>

> Hi,
> In debug mode I need to write to my application log the reason why certain
> rule failed to be activated.
> I'm familiar with the "Audit view" but the data isn't sufficient. It
> doesn't write the reason why rule wasn't activated only successful
> activation.
> For example:
>
> DRL file :
>
> rule "rule1"
>   when
>    Person(name matches "gogo")
>   then
>     System.out.println("gogo");
> End
>
> In main class :
>
> Person A = new Person("dodo");
> Person b = new Person("gogo");
>
> newStatefulSession.insert(A);
> newStatefulSession.insert(c);
> newStatefulSession.fireAllRules();
>
>
> I would like to write to log something like:
>
> Rule1 wasn't activated since the condition "dodo" matches "gogo" returned
> false for object Person(dodo)...
>
> Any idea how can I get the rule run results?
>
> Thanks,
> Meny
>
> _______________________________________________
> 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/20090421/4ed5593d/attachment.html 


More information about the rules-users mailing list