Hi,

Using exampl from Jess In Action, I code the folloing
in Java, but ios is not working, it throws null
pointer exception of variable Result. PLease advice.


            //RULE
            merlinMain.r.clear();
           
merlinMain.r.executeCommand("(do-backward-chaining
r-adv-type)");

            merlinMain.r.executeCommand("(defrule
r-adv-type" +
            "(need-adv-type ?x ?)" +
            "(adv-attr target audience
demographically)" +
            "(adv-attr suitable to market time frame
sensitive product)" +
            "=>" +
            "(assert (adv-type radio-advertisement
radio)))");

            merlinMain.r.executeCommand("(defrule
r-adv-type-ask" +
            "(adv-type-ask)" +
            "(adv-type ?x ?y)" +
            "=>" +
            "(store result ?x))");


            merlinMain.r.reset();

            merlinMain.r.executeCommand("(assert
(adv-attr target audience demographically))");
            merlinMain.r.executeCommand("(assert
(adv-attr suitable to market time frame sensitive
product))");
            merlinMain.r.executeCommand("(assert
(adv-type-ask))");
            merlinMain.r.executeCommand("(assert
(adv-type ?x))");

            merlinMain.r.run();

            Value va =
merlinMain.r.executeCommand("(facts)");
            String str1 =
merlinMain.r.fetch("result").stringValue(merlinMain.r.getGlobalContext());

            System.out.println("----"+str1);


                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to