Hi,

Question How can I use Value object to put in simple strings instead of
java.lang.String instances.?

-I wish to be able to assert facts from Java such that the rules in the
knowledge base can apply to them.
-Currently, I use assertString().
-When I use assertFact() the rules do not apply to the fact as with
assertString()
This is because the slot values are now java.lang.String instances.

How can I avoid building the string for assertString() and use assertFact()
such that the rules
process facts thus asserted?


My code:
=============================================
// (deftemplate Authorization (slot subject ) (slot predicate) (slot
object))

//create fact
Fact fact = new Fact("Authorization", r);

set values
Value va = new Value("a");
fact.setSlotValue("subject", va);
Value vb = new Value("b");
fact.setSlotValue("predicate", vb);
Value vc = new Value("c");
fact.setSlotValue("object", vc);

//assert the fact
rete.assertFact(fact);

// this retractString has no effect.
rete.retractString("(Authorization (subject a) (object c) (predicate b))");
=============================================


Thank you,
-Kartik Tadanki

Reply via email to