---------- Initial Header ----------- >From : [EMAIL PROTECTED] To : "jess-users" [email protected] Date : Thu, 14 Feb 2008 17:09:47 -0500 Subject : Re: JESS: load-function problem
> That doesn't mean that your Userfunction class can't have the > constructor you want though; you just can't use load-function. You > could load it from Java using, for example > > Rete engine = ... > engine.addUserfunction(new MyFunctionClass(arg1, arg2)); > > or from Jess, by calling these same Java methods: > > ((engine) addUserfunction (new MyFunctionClass arg1 arg2)) > 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)) 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? Many thanks again, Marco Zappatore -------------------------------------------------------------------- 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] --------------------------------------------------------------------
