Beta Release Version 0.3 of CLIPSJNI, a Java Native Interface for
CLIPS, is available for download at
https://sourceforge.net/projects/clipsrules/files/CLIPS/6.30/
It includes 4 examples of a CLIPS program integrated with Swing GUIs.
Instructions for running the programs are in the file Instructions.pdf
included within the .zip file. This is primarily a "proof of concept"
release to demonstrate basic techniques for integrating CLIPS with a
GUI.
Version 0.3 changes the manner in which the Java and C environments
interact to perform garbage collection which corrects crashes that
occurred when creating multiple CLIPS environments.
When creating multiple environments, call the destroy method when an
environment is no longer needed. This will free the C data structures
associated with the environment.
clips = new Environment();
.
.
.
clips.destroy();
Calling the clear, reset, load, loadFacts, run, eval, build,
assertString, and makeInstance methods can trigger CLIPS garbage
collection. If you need to retain access to a PrimitiveValue returned
by a prior eval, assertString, or makeInstance call, retain it and
then release it after the call is made.
PrimitiveValue pv1 = clips.eval("(myFunction foo)");
pv1.retain();
PrimitiveValue pv2 = clips.eval("(myFunction bar)");
.
.
.
pv1.release();