Ah, an else clause, an else clause, my kingdom for an else clause! :)
--- On Tue, 4/21/09, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
Subject: Re: [rules-users] Get the reason why certain rule failed to be activated.
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Tuesday, April 21, 2009, 8:35 AM
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(a)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(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users