I created a fact type in my code but I am getting exceptions:
declare Airline
name:String
end
and this is the java code that I am using.
DroolsXPathEvaluatorFactory evaluatorFactory=new
DroolsXPathEvaluatorFactory();
evaluatorFactory.setPackageStream(TestMain.class.getResourceAsStream("rule1.drl"));
KnowledgeBase kbase=KnowledgeBaseFactory.newKnowledgeBase();
FactType airlineType=kbase.getFactType("droolshelloworld",
"Airline");
Object ob=airlineType.newInstance();
airlineType.set(ob, "name", "//Airline");
StatefulSession
ksession=evaluatorFactory.getRuleBase().newStatefulSession(true);
ksession.insert(ob);
ksession.fireAllRules();
XPathEvaluator evaluator=evaluatorFactory.create();
evaluator.evaluate(TestMain.class.getResourceAsStream("test.xml"));
This is giving me exception. Please tell me what am I doing wrong here?
--
View this message in context:
http://drools.46999.n3.nabble.com/Pass-Parameter-to-drools-file-dynamical...
Sent from the Drools: User forum mailing list archive at
Nabble.com.