Mrinal,
it is routinely done, just use it as function:
(new chars.Ssomething (engine))
Dusan Sormaz
At 11:08 PM 4/7/2007, you wrote:
Hi,
i have the following rule.
(defrule someRule
"comment"
(Callhome (thing1 ?a)(thing2 ?b))
(test (try
(eq ?a ?b)
catch
FALSE))
;(test(eq ?b TRUE))
=>
(printout t crlf (jess-type engine) )
(new chars.Ssomething engine)
(try (printout t "done" crlf) catch )
)
and my Ssomething program looks like this
package chars;
import jess.Rete;
public class Ssomething {
public Ssomething(Rete engine){
try {
System.out.println (engine.eval("(printout t crlf
\"helloworld\")"));
} catch (Exception Ex) {
Ex.printStackTrace();
}
}
}
Now as seen above , i want to pass the refernce of me rete (engine) from
my jess rule to my java program, can this be done?
Actually i have three programs running.
1. this is the main web application for the user interface
2. from this main application i am calling the Jess engine and passing
facts and rules to it.
Now in the conclusion of the rule i am running a expect script
which later calls a different java program itself.
3. Here in this java program(called from expect) i want to create another
fact and pass it to the engine. So can i pass the reference of the jess
Engine from the jess rule itself (something like "this")?
Thanks,
Mrinal
*********************************************************************
* Dusan Sormaz, PhD, Associate Professor
* Ohio University
* Industrial and Manufacturing Systems Engineering Department
* 277 Stocker Center, Athens, OH 45701-2979
* phone: (740) 593-1545
* fax: (740) 593-0778
* e-mail: [EMAIL PROTECTED]
* url: <http://www.ent.ohiou.edu/~sormaz>http://www.ent.ohiou.edu/~sormaz
*********************************************************************