You can also write your rules in DRL which is much, much easier (especially in eclipse) and then convert it to XML, like this:

public static synchronized String convertDrlToXmlRule(String drlRule)
throws DroolsParserException {
DrlParser parser = new DrlParser();
PackageDescr descr = parser.parse(drlRule);
XmlDumper dumper = new XmlDumper();
String xmlDumped = dumper.dump(descr);
// XmlPackageReader xmlReader = new XmlPackageReader();
return xmlDumped;
}

Also, there are some examples in the documentation pages.
_ miguel



2010/5/5 Esteban Aliverti <esteban.aliverti@gmail.com>
You can always take a look at the tests in the source code.

2010/5/5 ashok kumar <softwarebuddy99@gmail.com>
Hi Team,

I need sample java code that on Drools v5.0.. can anyone share the rule XML file format along with the sample code
that fires the rules defined in XML? Do i need to save the file with '.xml' extension or it will be XML data in .drl file?
Please throw some light on this..

Thanks,
JFly.
 



_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
"To understand what is recursion you must first understand recursion"