As an aside, if you can change the rule definitions it'd be preferable to
remove the eval:-
rule "EmailVerificationCheck"
salience 500
when
$c : RuleContext (paymentMethod == "P_EXPRESS", trustedUser==false)
$a : RuleAction (action == null || == "VERIFY")
then
...
end
isTrustedUser() is a member of RuleContext and you can therefore access it's
boolean properties like any other.
Also, you could split the RHS into different rules too:-
rule "EmailVerificationCheck #1"
salience 500
when
$c : RuleContext (paymentMethod == "P_EXPRESS", trustedUser==false,
PEmailVerified==false)
$a : RuleAction (action == null)
then
modify($a) {
setAction ("VERIFY");
}
end
rule "EmailVerificationCheck #2"
salience 500
when
$c : RuleContext (paymentMethod == "P_EXPRESS", trustedUser==false,
PEmailVerified==false)
$a : RuleAction (action == "VERIFY")
then
$a.getRuleNames().add("PEmailVerificationCheck");
update($a);
end
2010/9/28 Vincent Legendre <vincent.legendre(a)eurodecision.com>
Hi,
The follwing error seems to mean that context is defined twice. May be that
"context" is a reserved global variable in drools 5.
Try to remane it in your rule, and check doc for more explanations
com/playspan/rule/Rule_PayPal_EmailVerificationCheck_0Eval0Invoker.java
(16:48) : *Redefinition of local variable "context"*
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users