I think that Zoltan wrote:
>>I am trying to use a defquery in RHS of a rule, but for some
>>reason it returns an empty iterator only... What could be the reason?

Hi Zoltan,

I looked at your code, and the main problem that I see is the line:

  (bind ?it (run-query find-threshold '?eventSource')) ;; this won't find
anything! :-D

You are passing the argument to the (defquery find-threshold) as a string
and not a variable as expected.

Also, have you defined deftemplates elsewhere for the RawEvent and
BaseServiceObject facts?
In your rule as coded, Jess complains that these are ordered facts, and it
doesn't like that you've added slots to them.

BTW - One thing that I learned early was that defqueries, while powerful,
can be easily abused.  If I found myself wanting to  procedurally iterate
over a collection of facts rather than let a rule pick them off one by one,
then I was usually violating my Zen of Jess
http://herzberg.ca.sandia.gov/jess/zen.shtml .  I suspect that Ernest will
ask you, "Why aren't you letting the rule do this for you?".

So, if you have to do it this way, I'd suggest wrapping it in a function
call rather than cram all that code into the RHS of your rule.  I poked
around with this but quickly realized that I can't offer you any meaningful
working code unless I know more about your deftemplates and what your
application is supposed to do.

Hope this all helps!

Cheers,
Jason
------------------------

Jason Morris
Morris Technical Solutions
[EMAIL PROTECTED]
www.morristechnicalsolutions.com
fax/phone: 503.692.1088



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to