JESS: Bug?

2005-12-08 Thread Yura
Hi jess-users

JessDE doesn't parse this rule (saying: 'TRUE' is a symbol, not an integer):

(defrule rule (declare (salience (+ 1 1))) = )

whereas Jesp makes no complaints.

Yuri


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]




Re: JESS: Probelm with property change listeners in Jess7b4

2005-12-08 Thread ejfried
Hi,

In Jess 7.0b3, the default for definstance type changed from dynamic
to auto. If you specified dynamic as the last argument to
definstance, then Jess would try to register itself with your Bean as
a PropertyChangeListener; this used to be the default, so that you had
to write static if you didn't want this behavior. The new default is
auto. In this case, Jess looks at the Bean to see if it accepts
PropertyChangeListeners and only registers itself if the Bean does,
indeed, accept them.

Jess's current definition of indeed accepts them is that the
following two methods exist with these exact signatures:

public void addPropertyChangeListener(PropertyChangeListener);
public void removePropertyChangeListener(PropertyChangeListener);

So if this worked for you in dynamic mode, my guess is that your
Beans don't have the removePropertyChangeListener method. The right
thing to do is add it, but a band-aid would be to say

(definstance block ?g dynamic)

This will work until you try undefinstance which, of course, won't
work (it never did.)

If I've guessed wrong, and it's something else, let me know, please!

I think Dusan Sormaz wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
 I am running example that uses property change listeners to update shadow 
 fact when object changes.
 
 Problem that I have is that running same code in Jess7.0b2 and Jess7.0b4 
 produces different results. Here is the log for both:
 
 Jess, the Rule Engine for the Java Platform
 Copyright (C) 2005 Sandia Corporation
 Jess Version 7.0b4 11/1/2005
 
 Jess (require defclasses)
 defclasses
 Jess (bind ?g (new Block G))
 Java-Object:edu.ohiou.imse.ise891.blockworld.Block
 Jess (definstance block ?g)
 Fact-0
 Jess (facts)
 f-0   (MAIN::block (class Java-Object:java.lang.Class) (name G) (OBJECT 
 Java-Object:edu.ohiou.imse.ise891.blockworld.Block))
 For a total of 1 facts in module MAIN.
 Jess (?g setName gfd)
 before PCS
 after PCS
 Jess (facts)
 f-0   (MAIN::block (class Java-Object:java.lang.Class) (name G) (OBJECT 
 Java-Object:edu.ohiou.imse.ise891.blockworld.Block))
 For a total of 1 facts in module MAIN.
 Jess
 
 
 Jess, the Rule Engine for the Java Platform
 Copyright (C) 2005 Sandia Corporation
 Jess Version 7.0b2 8/11/2005
 
 Jess (require defclasses)
 defclasses
 Jess (bind ?g (new Block G))
 External-Address:edu.ohiou.imse.ise891.blockworld.Block
 Jess (definstance block ?g)
 Fact-0
 Jess (facts)
 f-0   (MAIN::block (class External-Address:java.lang.Class) (name G) 
 (OBJECT External-Address:edu.ohiou.imse.ise891.blockworld.Block))
 For a total of 1 facts in module MAIN.
 Jess (?g setName gfd)
 before PCS
 after PCS
 Jess (facts)
 f-0   (MAIN::block (class External-Address:java.lang.Class) (name gfd) 
 (OBJECT External-Address:edu.ohiou.imse.ise891.blockworld.Block))
 For a total of 1 facts in module MAIN.
 Jess
 
 
 While Jess7.0b2 works as expected, Jess7.0b4 doe snot update fact when 
 object changes.
 
 Any ideas why is this happening?
 
 Dusan Sormaz
 
 
 
 *
 * Du_an _ormaz, PhD, Associate Professor
 * Ohio University
 * Industrial and Manufacturing Systems Engineering Department
 * 277 Stocker Center, Athens, OH 45701-2979
 * phone: (740) 593-1545
 * fax:   (740) 593-0778
 * e-mail: [EMAIL PROTECTED]
 * url: http://www.ent.ohiou.edu/~sormazhttp://www.ent.ohiou.edu/~sormaz
 *  



-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]




Re: JESS: Bug?

2005-12-08 Thread ejfried
I think Yura wrote:
[Charset koi8-r unsupported, filtering to ASCII...]
 Hi jess-users
 
 JessDE doesn't parse this rule (saying: 'TRUE' is a symbol, not an integer):
 
 (defrule rule (declare (salience (+ 1 1))) = )
 
 whereas Jesp makes no complaints.

Yep. I can reproduce this and now that you point it out, I immediately
see what's happening. Thanks for the report.



-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]