Hello,
I am working on Java/Jess project for my diploma thesis. I am still not a
Java Pro and I am completely new with Jess or any other RuleEngine/Clips
stuff.
Let me describe my problem for you. I have already integrated the Jess Rule
Engine and it is running.
In Java I have a Class like this:
public class ImportModel{
//this is a class variable:
private Hashtable <Individual, Vector<Individual>> processTable;
....
// I fill this hashtable with some data in the "Class-Body"
// there also exists a getter fort his hashtable.
}
I also have a Class like this:
public class OwlContainer {
private ImportModel repositoryModel;
private Hashtable <Individual, Vector<Individual>> repositoryProcessTable;
//the getters also exist
//Load Repository:
File repositoryFile = new File("D:/eigeneProjekte/test/test-s-t-s.owl");
if (repositoryFile != null & repositoryFile.exists()){
repositoryModel = new ImportModel(repositoryFile);}
}
My Ruleengine Class looks like this:
public class RuleEngine {
private Rete engine;
private WorkingMemoryMarker marker;
private OwlContainer owlContainer;
public RuleEngine (OwlContainer aOwlContainer) throws JessException{
//Create a Jess Rule Engine
engine = new Rete();
engine.reset();
// Load Rules into Engine
String path =
"D:/eigeneProjekte/eclipse/.../.../bin/org/sempet/engine/rules.clp";
engine.batch(path);
owlContainer = aOwlContainer;
//now the problems begin
//do I have to Add the owlContainer, the ImportModel or only the HashMap?
//like this:
engine.add(owlContainer);
engine.add(owlContainer.getImportModel());
engine.add(owlContainer.getRepositoryProcessTable());
// or direktly an ImportModel object?
Now my question(s): can you give some code example how I can write a rule
which refers to the hashtable? Perhabs a simple Example how I can define a
rule which just prints out the Individuals in the vector in the Value-part
of the Hashtable?
What do I have to add to the rule engine?
And what kind of (deftemplate ImportModel (declare(from-class
ImportModel))) things do I have to define in the rules.clp?
I hope you can help me out with my problem.
Thanks alot
Kind regards,
Waschtl
--
View this message in context:
http://www.nabble.com/Java-and-Jess%3A-Hashtable-etc.-tf4653348.html#a13295080
Sent from the Jess mailing list archive at Nabble.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]
--------------------------------------------------------------------