It would help to see the &quot;BRL Source&quot; and the &quot;Generated DRL&quot;. Change views at the bottom of the window.<br>-W<br><br><div class="gmail_quote">2011/5/18 Abhay B. Chaware <span dir="ltr">&lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Also, if I understand correctly what you are trying to do, you should
probably add a variable name to the PersonDetails fact and use that in the
&quot;then&quot; part to assign the discount. See attached.</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"><img src="cid:image001.jpg@01CC1560.4E67F020" height="320" width="608"></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">-----Original Message-----<br>
From: <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Sumeet Karawal<br>
Sent: Wednesday, May 18, 2011 11:47 AM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Facing Problem in BRL</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">This is the brl that I have created:</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">(Embedded image moved to file: pic18001.jpg)</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Regards,</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Sumeet Karawal</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Mailto: <a href="mailto:sumeet.karawal@tcs.com" target="_blank">sumeet.karawal@tcs.com</a></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                                                                                                                      
</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">  From:       &quot;Abhay B.
Chaware&quot;
&lt;<a href="mailto:Abhay.Chaware@kpitcummins.com" target="_blank">Abhay.Chaware@kpitcummins.com</a>&gt;                                                      
</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">               
                                                                                                       </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">  To:         Rules Users
List
&lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;                                                          
</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                               
                                                                                       </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">  Date:       05/18/2011 11:42
AM                                                                                     
</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                                               
                                                                       </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">  Subject:    Re: [rules-users] Facing Problem in
BRL                                                                 
</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                                                               
                                                       </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">  Sent by:   
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>                                                                     
</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                                                                               
                                       </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Could you post your rule content here ?</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">-----Original Message-----</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">From: <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Sumeet Karawal</span></font></p>


<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Sent: Wednesday, May 18, 2011 11:38 AM</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">To: <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Subject: [rules-users] Facing Problem in BRL</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Hi,</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">I am using Drools-Expert. I am having a class &quot;Person&quot; with
data members as</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">age and discount.</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">I am trying to create a .brl. I have these statements in drools.package</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">package com.rules;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">import com.model.PersonDetails;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">and in the example.brl I am providing the details of when and then</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">conditions</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">but on execution I am getting the following error :</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">java.lang.RuntimeException: [4] Unable to expand: PersonDetails( age
&lt;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">&quot;20&quot; )[6] Unable to expand:                      PersonDetails
fact0 = new</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">PersonDetails</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">();[7] Unable to expand:                         fact0.setDiscount</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">( 10 );[8] Unable to</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">expand:                        insert(fact0
);</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">It would be helpful is somebody guide me on how execute it.</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Also, I am creating the knowledgebase as:</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">private static KnowledgeBase createKnowledgeBase() {</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> KnowledgeBuilder builder =
KnowledgeBuilderFactory.newKnowledgeBuilder();</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">    builder.add (ResourceFactory.newClassPathResource(</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">&quot;com/rules/example.brl&quot;),ResourceType.BRL);</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">    if (builder.hasErrors()) {</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">      throw new RuntimeException
(builder.getErrors().toString ());</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">    }</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">    KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">   
knowledgeBase.addKnowledgePackages(builder.getKnowledgePackages ());</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">    return knowledgeBase;}</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Thanks &amp; Regards,</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Sumeet Karawal</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">CEG - Open Source Technology Group</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Tata Consultancy Services</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Ph:- +912267782556</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Cell:- +919833236440</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Mailto: <a href="mailto:sumeet.karawal@tcs.com" target="_blank">sumeet.karawal@tcs.com</a></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Website: <a href="http://www.tcs.com" target="_blank">http://www.tcs.com</a></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">____________________________________________</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Experience certainty.         
IT Services</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                                     Business
Solutions</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">                                     Outsourcing</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">____________________________________________</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">=====-----=====-----=====</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Notice: The information contained in this e-mail</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">message and/or attachments to it may contain</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">confidential or privileged information. If you are</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">not the intended recipient, any dissemination, use,</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">review, distribution, printing or copying of the</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">information contained in this e-mail message</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">and/or attachments to it are strictly prohibited. If</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">you have received this communication in error,</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">please notify us by reply e-mail or telephone and</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">immediately and permanently delete the message</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">and any attachments. Thank you</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">_______________________________________________</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">rules-users mailing list</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span></font></p>


<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">_______________________________________________</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">rules-users mailing list</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span></font></p>


<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">=====-----=====-----=====</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Notice: The information contained in this e-mail</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">message and/or attachments to it may contain </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">confidential or privileged information. If you are </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">not the intended recipient, any dissemination, use, </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">review, distribution, printing or copying of the </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">information contained in this e-mail message </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">and/or attachments to it are strictly prohibited. If </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">you have received this communication in error, </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">please notify us by reply e-mail or telephone and </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">immediately and permanently delete the message </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">and any attachments. Thank you</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>

</div>

<br clear="all"> This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.
</div>



<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></blockquote></div><br>