I am trying to add a slot to a template from within the jess language. From looking at the java API guide and some postings in this archive, I think I should be able to do something like:

(bind ?template ((engine) findDeftemplate "some-existing-template"))
(?template addSlot "some-new-slot" (get-member Funcall NIL) "ANY")

to add a blank slot. However a call to (show-deftemplates) then generates a NullPointerException reported as

Jess reported an error in routine call
while executing (call (new jess.PrettyPrinter (call ?__e next)) toString)
while executing (printout t crlf (call (new jess.PrettyPrinter (call ?__e next)) toString) crlf)
while executing (while (call ?__e hasNext) (printout t crlf (call (new jess.PrettyPrinter (call ?__e next)) toString) crlf))
while executing deffunction show-deftemplates
while executing (show-deftemplates).
Message: Called method threw an exception.
Program text: ( show-deftemplates ) at line 6.
Nested exception is:
null
java.lang.NullPointerException
at jess.PrettyPrinter.visitDeftemplate(PrettyPrinter.java:55)
at jess.Deftemplate.accept(Deftemplate.java:367)
at jess.PrettyPrinter.toString(PrettyPrinter.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25)



Any hints on how to add a generic slot to an existing template from within jess?


Thanks,

Bill Butler

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