Hello there
I have a question regarding using the Fact & Value Class within Java.
- What is happening during "r.assertFact(f)", does Jess deal internally
with a copy of "f" or is this still the original object? If I do change
after "assert()" the values from f are they going to be considered
within Jess ? And the other way round, means if a rule change the "f",
do I still retrieve over the "f" the actual values ? i.e.
Rete r = new Rete();
r.executeCommand("(deftemplate event (slot type) (slot amount
(type integer))");
Fact f = new Fact("event", r);
f.setSlotValue("type", new Value("A", RU.ATOM));
r.assertFact(f);
f.setSlotValue("amount", new Value(3, RU.INTEGER)); // is
this value considered from "r" ?
f.setSlotValue("type", new Value("B", RU.ATOM)); // is
this allowed to update a value ?
// add some rules and execute it
r.executeCommand("...");
r.reset();
r.run()
Value v = f. getSlotValue(("type");
String type = v.atomValue(c); // what do I get here,
is "f" still the actual reference ?
- The jess.Value has the possibility to set Values during the
construction. But for retrieving a Context object is necessary. So where
can I get this Context object ? I know that this is depending from the
current Context as mentioned in the manual.
Rete r = new Rete();
r.executeCommand("(deftemplate event (slot type))");
Fact f = new Fact("event", r);
f.setSlotValue("type", new Value("A", RU.ATOM));
r.assertFact(f);
Value v = f. getSlotValue(("type");
v.atomValue( ????? ); // which context reference have I to use
here ?
- I think you recommend more to use java beans and let them convert into
facts and "back" (update the bean) instead of using directly Facts and
Values?
Thank you in advance
Regards
Mark
--------------------------------------------------------------------
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]
--------------------------------------------------------------------