JESS:Modular deffacts problem

2005-11-02 Thread David Firmin

Hi

I'm having a problem with deffacts and modules I was hoping someone could
help me out with.

I'm trying to use deffacts with a specific module, but am having some
problems changing out of that module once the deffacts has taken place.
At present, I'm doing the following (although I've simplified the code
here, the sense remains the same):

(defmodule ONE)
(defmodule TWO)
(defmodule THREE)

(set-current-module MAIN)

(deftemplate TWO::template-for-module-two
  (slot slot1)
)

(deffacts some-facts
  (TWO::template-for-module-two (slot1 value1))
  (TWO::template-for-module-two (slot1 value2))
)

;;; some business logic rules

(reset)

Once the code has been parsed into the Rete [ using executeCommand(String)]
I then subsequently assert some shadow fact objects before running the
rete. The problem is that the shadow facts are asserted into the TWO module
rather than the MAIN module as I would like them to be. It seems my call to
set-current-module is being overridden by the deffacts construct asserting
facts straight into the TWO module.

Is there a way around this so that once the reset command has been called,
the focus shifts back to MAIN automatically?

Any help would be gratefully received.


Many thanks
Regards
David


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: Problem with definstance

2005-10-07 Thread David Firmin

Thanks again.

I've identified the problem. I had bean properties for all slots, but some
of the slot names started with capital letters which seemed to throw
definstance (I should have thought of this earlier).

I've resolved this by renaming the slots so that they're more in line with
the bean specs.

Thanks for all your help
Regards
David



   
 ejfried   
 Sent by:  
 owner-jess-users@  To 
 sandia.govjess-users@sandia.gov   
cc 
   
 05/10/2005 20:03  Subject 
   Re: JESS: Problem with definstance  
   
 Please respond to 
 [EMAIL PROTECTED] 
   .gov
   
   




I think David Firmin wrote:

 Hi,
 Thanks for this, although I'm still missing something I think.

 The Order class I'm trying to define as an instance does have accessors
and
 modifiers for all its properties, including the two defined on the
 superclass deftemplate that's already been created in the Rete.

To clarify, yes or no: does the template define any slots that
*don't* correspond to properties in the Order class?


-
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]



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]