[rules-users] Newbie question: can I create a variable in the rules file?

Rented User rented at gmail.com
Sat Mar 10 03:36:38 EST 2007


Sigh! I don't understand what is going on.

I added another rule which is almost identical:

rule BidderReqCorrection
  no-loop
  activation-group "permissions"
when
  c: PermissionCheck(name == "stuff", action == "find", granted = false)
  Role(name == "A Role")
  AppProp(now == (new Date()), s: startDate -> (s.getTime() < now.getTime()),
e: endDate -> (e.getTime() > now.getTime()) )
then
  c.grant();
  modify(c);
end;

But now I get the error:

org.drools.rule.InvalidRulePackage: Unable to create Field Extractor for
'now'
Rule Compilation error Unknown variable or type "now" Class "
java.lang.Object" has no method named "getTime" Expression "now" is not an
rvalue Expression "now" is not an rvalue Expression "now" is not an rvalue
Exception:null

Its a copy-and-paste from the first rule. Just changed the action from "do"
to "find".
It does not matter if I comment out all the other rules or not. This new
rule always causes the error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070310/50dc0b35/attachment.html 


More information about the rules-users mailing list