Hi,
This is probably easy onem, but I can't figure it out. I need to do object
validation, and have flag "passed" set from within my rule.
_________________________________________________________
This is my cpl file
(import com.mycompany.yadda.yadda.MC)
(deftemplate MC(declare (from-class MC)))
(defrule mcrule
"Rule 11"
(MC {fg == "P"})
=>
(printout t "Rule 11" crlf)
(call ?MC setPassed TRUE)
)
_______________________________________________________________
and this is how I call it from Java:
engine.resetToMark(marker);
MC mc = new MC();
mc.setfg("P");
MC mc1 = new MC();
mc1.setfg("D");
engine.add(mc);
engine.add(mc1);
engine.run();
return engine.getObjects(new Filter.ByClass(MgmtChars.class));
_____________________________________________________________________
Rules are validated correctly, but when it executes method setPassed it
throws exceptions: "No such variable MC", and that is correct. I simply
don't know how to reference/access object that rule is currently executed
on. If you can shed some light on it that would be really appreciated.
Thanks,
Ed
--
View this message in context:
http://www.nabble.com/Jess-newbie-does-not-know-how-to-....-tp15837006p15837006.html
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]
--------------------------------------------------------------------