RE: JESS: How can I write this rule?

2007-10-20 Thread Nicolas Fortin
Hello everybody, I have just added a bit more complexity to the previous rule and now I have the following template: (deftemplate MAIN::My-Template (slot id (type INTEGER)) (slot enabled (default FALSE)) (slot index1 (type INTEGER)) (slot index2 (type INTEGER))) What I want to

Re: JESS: Java and Jess: Hashtable etc.

2007-10-20 Thread Robert Kirby
When you add (assert) a Hashtable fact, there's only a single fact. The Jess engine can act on the existence of that fact and the top-level values of slots, not on methods on the contents of slots, such as Hashtable::containsKey(object key) or Hashtable::get(object key). You probably would be

Re: JESS: Java and Jess: Hashtable etc.

2007-10-20 Thread Wolfgang Laun
Hello Waschtl, Neither the code snippets nor the explanations you provided indicate what sort of facts you want to process with your rules, so I'm using classes of my own, which describe the facts I'm going to use: public class Song { private String myTitle; private String myAuthor;

RE: JESS: How can I write this rule?

2007-10-20 Thread Robert Kirby
If you want to consider only enabled instances, (defrule CP::enabled-example-rule Enabled My-Template with the greatest index1 and among those enabled with the smallest index2. (My-Template (id ?id) (enabled TRUE) (index1 ?index1) (index2 ?index2)) (not (My-Template (enabled TRUE)