On Feb 18, 2008, at 11:17 AM, Marco Zappatore wrote:


First of all, many thanks for your reply.

Now, let me say if I correctly understood.
The procedure is:

1. create my java function implementing UserFunction class

2. add this one to the instance of the jess engine in my
   java application by using the command:
   myJessEngineInstance.addUserfunction (new MyJavaFunctionClass
(myArg1));

3. load this one in jess (for instance in a Jess file)
   by the command:
   ((engine) addUserfunction (new MyJavaFunctionClass myArg1))


You only have to do one of 2 or 3, not both! Either one is fine.


4. use the function (for instance in a RHS section of a rule)
   launching the command (declared in getName() method)
   (my-function someArg)

Anyway, following this procedure I'm still having an "undefined
function" warning when I use (my-function someArg)
in my Jess file. As a result, launching my application,
that java function can't be used from Jess; what's wrong
in the previous steps?

If you successfully do steps 2 or 3, and there are no errors
reported, then the function is definitely available under the name
given. Make sure the name is exactly the same as the name you're
using in your Jess code to call it.

Now, you say something about a "warning", and so maybe you're talking
about the JessDE? In that case, you need to make sure the
Userfunction class is on the Java build path of your project so that
the editor can find it.


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

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