<br> Best way to investigate this is to expand your DSL to the DRL to check how the expansion is working.<br><br> DrlParser parser = new DrlParser();<br> String expanded = parser.getExpandedDRL( drlSourceString, dslReader );
<br> <br> Check what is wrong in the expanded DRL. I see your map has an error:<br><br>$stud : Student(name == "{studName}")<br><br> The comparison must be made with '==' as above instead of '=' as in your template. But I don't know if that is the only problem.
<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/7/12, McShiv <<a href="mailto:rajesh_sachin10@yahoo.co.in">rajesh_sachin10@yahoo.co.in</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi All,<br><br> I used the following code in the dsl file.<br><br>DSL:<br><br> [when] Check whether the name is present as "{studName}" = $stud :<br>Student(name = "{studName}");<br> [then] Set the Error Code {errorCode} = String string = $stud.getName();
<br>Error(errorCode, string);<br><br>DRL:<br><br> package com.policy;<br> expander StudendProgram.dsl;<br> import java.util.Iterator;<br> import com.class.Student;<br> import com.class.Error;<br><br> rule "StudendProgram_1"
<br><br> when<br> Check whether the name is present as "Stephen"<br> then<br> Set the Error Code 88<br> end<br><br><br>When I try to run this program I got the following error.
<br><br> Caused by: org.drools.rule.InvalidRulePackage: Rule Compilation error<br>File com/policy/Rule_SpeCodeSpeValProdPlan12_0.java, Line 12, Column 176:<br>Unexpected token "." in primary<br><br>When I remove the Line "$stud.getName();" in the then part and set the error
<br>code alone its working fine. The "." inbetween $stud and getName() may be<br>the problem. But I don't know the solution for this.<br><br>Any suggessions on this.<br><br>Thanks,<br>McShiv....<br>--<br>View this message in context:
<a href="http://www.nabble.com/Compilation-Error-in-Drools-tf4071029.html#a11569413">http://www.nabble.com/Compilation-Error-in-Drools-tf4071029.html#a11569413</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">
Nabble.com</a>.<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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646
<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>