[rules-users] Need Sample Java Code

miguel machado mls.machado at gmail.com
Thu May 6 03:45:31 EDT 2010


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 at gmail.com>

> You can always take a look at the tests in the source code.
>
> 2010/5/5 ashok kumar <softwarebuddy99 at 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 at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
> Esteban Aliverti
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
"To understand what is recursion you must first understand recursion"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100506/1abbb2c9/attachment.html 


More information about the rules-users mailing list