Which version of drools are you using?<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">I don't see org.drools.builder.impl.KnowledgeBuilderProviderImpl in the trunk.</span><br>
<br><div class="gmail_quote"><br></div><div class="gmail_quote">Best,</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Jun 16, 2010 at 9:33 AM, Fnu Mahalakshmi <span dir="ltr"><<a href="mailto:FMahalakshmi@nyx.com">FMahalakshmi@nyx.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
Yes I added the drools-compiler as a dependency.<br>
I have added all the required jars to my classpath.<br>
Any other error???<br>
Thanks<br>
M<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] On Behalf Of <a href="mailto:rules-users-request@lists.jboss.org">rules-users-request@lists.jboss.org</a><br>
Sent: Wednesday, June 16, 2010 8:25 AM<br>
To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
Subject: rules-users Digest, Vol 43, Issue 89<br>
<br>
Send rules-users mailing list submissions to<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:rules-users-request@lists.jboss.org">rules-users-request@lists.jboss.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:rules-users-owner@lists.jboss.org">rules-users-owner@lists.jboss.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of rules-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Dynamic Rule Loading (Esteban Aliverti)<br>
2. Re: rule error (Esteban Aliverti)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 16 Jun 2010 09:21:13 -0300<br>
From: Esteban Aliverti <<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>><br>
Subject: Re: [rules-users] Dynamic Rule Loading<br>
To: Rules Users List <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTil7CJpWIhO_eodIWM7vpgIS8NDzPyAP2Hx67JqO@mail.gmail.com">AANLkTil7CJpWIhO_eodIWM7vpgIS8NDzPyAP2Hx67JqO@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Are you including drools-compiler as a dependency?<br>
<br>
On Tue, Jun 15, 2010 at 5:28 PM, Fnu Mahalakshmi <<a href="mailto:FMahalakshmi@nyx.com">FMahalakshmi@nyx.com</a>>wrote:<br>
<br>
> Hi,<br>
><br>
> I was trying to use knowledge builder package for dynamic loading of the<br>
> rule files. Getting major errors.<br>
><br>
> My knowledge builder basically adds the rule resources from the<br>
> change-set.xml file which I have in my project directory.<br>
><br>
> I am using the knowledge agent and knowledge base to add all the packages<br>
> loaded from my change-set xml file.<br>
><br>
> Am I wrong somewhere???<br>
><br>
> My code is as follows:<br>
><br>
><br>
> private KnowledgeBase loadRules(String[] rules) throws Exception{<br>
><br>
> KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
> kbuilder.add( ResourceFactory.newClassPathResource(<br>
> "/change-set.xml", getClass() ),<br>
> ResourceType.CHANGE_SET );<br>
> if ( kbuilder.hasErrors() ) {<br>
> System.err.println( kbuilder.getErrors().toString() );<br>
> }<br>
> KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(<br>
> "MyAgent" );<br>
> kagent.applyChangeSet(<br>
> ResourceFactory.newClassPathResource("/change-set.xml", getClass()));<br>
> KnowledgeBase kbase = kagent.getKnowledgeBase();<br>
> kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());<br>
><br>
> return kbase;<br>
> }<br>
><br>
> my change-set.xml is as follows:<br>
><br>
> <?xml version="1.0" encoding="UTF-8"?><br>
> <change-set xmlns='<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>'<br>
> xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'<br>
> xs:schemaLocation='drools-change-set-5.0.xsd' ><br>
> <add><br>
> <resource source='src/main/rules/' type='DRL' /><br>
> </add><br>
> </change-set><br>
><br>
> I am getting the following error stack when I run:<br>
><br>
> Exception in thread "main" org.drools.ProviderInitializationException:<br>
> Provider org.drools.builder.impl.KnowledgeBuilderProviderImpl could not be<br>
> set.<br>
> at<br>
> org.drools.builder.KnowledgeBuilderFactory.loadProvider(KnowledgeBuilderFactory.java:111)<br>
> at<br>
> org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderProvider(KnowledgeBuilderFactory.java:101)<br>
> at<br>
> org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)<br>
> at com.org.RuleRunner.loadRules(RuleRunner.java:58)<br>
> at com.org.RuleRunner.runStatelessRules(RuleRunner.java:127)<br>
> at com.org.RulesTest.main(RulesTest.java:40)<br>
> Caused by: java.lang.ClassNotFoundException:<br>
> org.drools.builder.impl.KnowledgeBuilderProviderImpl<br>
> at java.net.URLClassLoader$1.run(Unknown Source)<br>
> at java.security.AccessController.doPrivileged(Native Method)<br>
> at java.net.URLClassLoader.findClass(Unknown Source)<br>
> at java.lang.ClassLoader.loadClass(Unknown Source)<br>
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)<br>
> at java.lang.ClassLoader.loadClass(Unknown Source)<br>
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)<br>
> at java.lang.Class.forName0(Native Method)<br>
> at java.lang.Class.forName(Unknown Source)<br>
> at<br>
> org.drools.builder.KnowledgeBuilderFactory.loadProvider(KnowledgeBuilderFactory.java:108)<br>
> ... 5 more<br>
><br>
><br>
> The error comes exactly at the start where I call knowledge builder.<br>
> Please help!!<br>
><br>
> Thanks<br>
> M<br>
><br>
> Please consider the environment before printing this email.<br>
><br>
> Visit our website at <a href="http://www.nyse.com" target="_blank">http://www.nyse.com</a><br>
><br>
> ****************************************************<br>
><br>
> Note: The information contained in this message and any attachment to it<br>
> is privileged, confidential and protected from disclosure. If the reader of<br>
> this message is not the intended recipient, or an employee or agent<br>
> responsible for delivering this message to the intended recipient, you are<br>
> hereby notified that any dissemination, distribution or copying of this<br>
> communication is strictly prohibited. If you have received this<br>
> communication in error, please notify the sender immediately by replying to<br>
> the message, and please delete it from your system. Thank you. NYSE<br>
> Euronext.<br>
><br>
><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
<br>
<br>
<br>
--<br>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
<br>
Esteban Aliverti<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20100616/83036389/attachment-0001.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20100616/83036389/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 16 Jun 2010 09:24:05 -0300<br>
From: Esteban Aliverti <<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>><br>
Subject: Re: [rules-users] rule error<br>
To: Rules Users List <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTin7WWH2t8YETZvExSa9bGHwh7lqBvUYZgRobVIW@mail.gmail.com">AANLkTin7WWH2t8YETZvExSa9bGHwh7lqBvUYZgRobVIW@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="windows-1252"<br>
<br>
I recommend you to read the manual first.<br>
<br>
2010/6/16 Giovanni Motta <<a href="mailto:mottagio@gmail.com">mottagio@gmail.com</a>><br>
<br>
> You have 2 options here:<br>
> status == ?yes" *||* status == "no"<br>
> status == ?yes" *||* == "no"<br>
><br>
> 'or' connector is not applied on constraints, but on patterns.<br>
><br>
> Regards<br>
><br>
> 2010/6/16 Fnu Mahalakshmi <<a href="mailto:FMahalakshmi@nyx.com">FMahalakshmi@nyx.com</a>><br>
><br>
>> Hi,<br>
>><br>
>><br>
>><br>
>> I want to just depict ?&&? and ?or? in my rules and did as follows:<br>
>><br>
>><br>
>><br>
>> *rule* "Update value?<br>
>><br>
>> *no-loop* *true*<br>
>><br>
>> *when*<br>
>><br>
>> $y :Y(name != "")<br>
>><br>
>> $x: X(status != "")<br>
>><br>
>> $z : Z( y == $y, x == $X,(status == ?yes" *or* status == "no"<br>
>> ))<br>
>><br>
>> *then*<br>
>><br>
>> *modify*($z){};<br>
>><br>
>><br>
>><br>
>> end<br>
>><br>
>><br>
>><br>
>> The above does not work. Is it not valid to write as above??<br>
>><br>
>> How else can I depict ?or? ? relation?<br>
>><br>
>> *rule* "Update value"<br>
>><br>
>> *no-loop* *true*<br>
>><br>
>> *when*<br>
>><br>
>> $y :Y(name != "")<br>
>><br>
>> $x: X(status != "")<br>
>><br>
>> $z : Z( y == $y, x == $X,(status == ?yes" *, *status == "no"<br>
>> ))<br>
>><br>
>> *then*<br>
>><br>
>> *modify*($z){<br>
>><br>
>> setOutput($z)};<br>
>><br>
>><br>
>><br>
>> end<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> even this does not work.<br>
>><br>
>><br>
>><br>
>> I also want to add all the values specific to this condition and just<br>
>> print them out in my output file.<br>
>><br>
>> So I tried adding it to a list (which is done by setOutput().<br>
>><br>
>> But here I keep getting multiple entries for the same value.<br>
>><br>
>> For eg. {a,b,c } //are instances of type z<br>
>><br>
>> They keep getting added again and again. Should it not process input only<br>
>> once????<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> Please help.<br>
>><br>
>><br>
>><br>
>> Thank you<br>
>><br>
>> m<br>
>><br>
>> ------------------------------<br>
>><br>
>> *Please consider the environment before printing this email.*<br>
>><br>
>> *Visit our website at <a href="http://www.nyse.com" target="_blank">http://www.nyse.com</a><br>
>> *****************************************************************************<br>
>><br>
>> Note: The information contained in this message and any attachment to it<br>
>> is privileged, confidential and protected from disclosure. If the reader of<br>
>> this message is not the intended recipient, or an employee or agent<br>
>> responsible for delivering this message to the intended recipient, you are<br>
>> hereby notified that any dissemination, distribution or copying of this<br>
>> communication is strictly prohibited. If you have received this<br>
>> communication in error, please notify the sender immediately by replying to<br>
>> the message, and please delete it from your system. Thank you. NYSE<br>
>> Euronext. *<br>
>><br>
>><br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>
>><br>
><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
><br>
<br>
<br>
--<br>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
<br>
Esteban Aliverti<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20100616/e0eb8962/attachment.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20100616/e0eb8962/attachment.html</a><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
End of rules-users Digest, Vol 43, Issue 89<br>
*******************************************<br>
Please consider the environment before printing this email.<br>
<br>
Visit our website at <a href="http://www.nyse.com" target="_blank">http://www.nyse.com</a><br>
<br>
****************************************************<br>
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>