Hello

 

I am trying to link rulebase to an interface.

 

On selecting the choice female from a combo box and clicking the ok button in frame1 frame2 should appear based on the rule testframe. The problem is though the fact is asserted and  rule is activated the rule does not fire ie. frame2 does not appear.  Is the way I wrote the rule incorrect.

 

The code snippet is given below. 

 

 

(deftemplate input

  (slot id)

  (slot text))

 

(do-backward-chaining answer)

 

 (defrule testframe

(declare (auto-focus TRUE))

(input (id choice1) (text female))

=>

(?*frame2* setVisible TRUE ))

 

{FRAME 1 SETUP CODE}

{FRAME 2 SETUP CODE}

 

 

(?*frame1* setVisible TRUE)

 

(deffunction combo-input (?EVENT)

 (assert (input (id gender)(text (sym-cat (?*frame1combo* getSelectedItem)))))

 

  (bind ?handler (new jess.awt.ActionListener combo-input(engine)))

  (?*ok*  addActionListener ?handler)

 

(set-reset-globals nil)

 

(reset)

(run)

 

Thanks for any suggestions

Jenny


Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!

Reply via email to