Alireza Khamesipour
Alireza Khamesipour

Reputation: 19

using Jess from Java

Hi, I have written all my code in JESS and now I wanted to use that code in Java. I wanted to know if I would need to redefine the deftemplates as in the textbook? Or is it possible to use that code with making some slight changes?

I have two clp files, a file which I have defined the deftemplates and deffacts, and another file which I have written my rules in.

Thanks Ali

Upvotes: 1

Views: 177

Answers (1)

laune
laune

Reputation: 31290

You can use code written in CLP without modifications by creating a jess.Rete object, using Rete.batch to load and execute the CLP files. You may call Rete.run if there's no (run) in your CLP file. You can use additional Rete methods for supportive functions, e.g., attaching a listener.

You have made no specific remarks on the use of the CLP code from Java, but there is no Jess feature you couldn't use via the API. It just requires reading the (excellent) javadoc.

Upvotes: 2

Related Questions