hmm.. there is a problem with the action of the 2nd rule, so, converting it to vanilla DRL:<br><br>rule "SpeCodeSpeValProdPlan12"<br>salience 50<br><br> when<br> ...<br> then<br> if(common.getProd() == "{prodCode1}" ||
common.getPlan() ==<br>"{planCode1}"){System.out.println("Error");}<br>end<br><br>That doesn't look quite right - you are doing == on strings - .equals would be better). I would try that rule on its own, without a DSL - to see what is causing it. Also - why are you doing the if on the RHS? I would get rid of that if at all possible to save confusion later.
<br><br><div><span class="gmail_quote">On 6/30/07, <b class="gmail_sendername">McShiv</b> <<a href="mailto:rajesh_sachin10@yahoo.co.in">rajesh_sachin10@yahoo.co.in</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>DRL Syntax<br>package com.policy;<br>expander SpeCodeSpeValProdPlan.dsl;<br>#list any import classes here.<br>import com.viking.common.transferbeans.CommonInformation;<br>import com.sentry.common.entitybeans.EntityBean
;<br>import com.sentry.common.entitybeans.Selected;<br>import java.util.ArrayList;<br>import java.util.List;<br>#declare any global variables here<br><br>rule "SpeCodeSpeValProdPlan11"<br>salience 100<br><br> when
<br> The EntityBean Contains Selected List<br> then<br> Assert All The Selected<br>end<br><br>rule "SpeCodeSpeValProdPlan12"<br>salience 50<br><br> when<br> The Question Code Is "License" And The Selected Value is "Y"
<br> then<br> Remove The Product "09" And Plan "CD"<br>end<br><br>DSL Syntax:<br><br>[when] The EntityBean Contains Selected List = entity : EntityBean();<br>eval(entity.getSelected() != null);<br>[then] Assert All The Selected = Object[] quoSelList =
entity.getSelected();<br>for(int i = 0; i < quoSelList.length; i++){ Selected queSel =<br>(Selected)quoSelList[i]; assert(queSel); System.out.println(queSel); }<br><br>[when] The Question Code Is "{speCode1}" And The Selected Value is
<br>"{speValue1}" = common : CommonInformation(); Selected(stateSpecificCode ==<br>"{speCode1}", stateSpecificValue == "{speValue1}");<br>[then] Remove The Product "{prodCode1}" And Plan "{planCode1}" =
<br>if(common.getProd() == "{prodCode1}" || common.getPlan() ==<br>"{planCode1}"){System.out.println("Error");}<br><br><br>The Selected Class is an Object Array inside EntityBean Class.<br>CommonInformation is a seperate class. CommonInformation & EntityBean will
<br>be available in Working Memory(asserted earlier in java class).<br><br> I need to remove the Selected Classes in the Object array and assert into<br>the working memory. Thats what I am doing in the First Rule.<br><br>
In the Second rule I check for some condition and print the error according<br>to the condition.<br>Thanks,<br>McShiv<br><br>Fernando Meyer Camargo wrote:<br>><br>> howdy,<br>><br>> is your package name right? please paste your rule code.
<br>><br>> Fernando Meyer<br>> <a href="mailto:fmcamargo@gmail.com">fmcamargo@gmail.com</a><br>> GPG: 5A6D 3374 B055 A513 9A02 A03B 3DB3 7485 D804 DDFB<br>><br>><br>> On Jun 29, 2007, at 10:16 PM, McShiv wrote:
<br>><br>>><br>>> com.package.FatalSystemException<br>>> at org.drools.rule.Package.checkValidity(Unknown Source)<br>>> at org.drools.reteoo.RuleBaseImpl.addPackage(Unknown Source)<br>
>> at<br>>> com.sentry.underwriting.ruleexecutor.DroolsExecutor.executeRules<br>>> (DroolsExecutor.java)<br>>> at<br>>> com.sentry.underwriting.ruleexecutor.RulesExecutionProcessor.callRules
<br>>> Executor(RulesExecutionProcessor.java:82)<br>>> at<br>>> com.sentry.underwriting.ruleexecutor.RulesExecutionProcessor.rulesExec<br>>> utionprocess(RulesExecutionProcessor.java:65)<br>>> at
<br>>> com.sentry.underwriting.ruleprocessor.RulesProcessor.processRules<br>>> (RulesProcessor.java)<br>>> at<br>>> com.sentry.underwriting.test.UnderwritingDemo.main<br>>> (UnderwritingDemo.java
:21)<br>>> Caused by: org.drools.rule.InvalidRulePackage: Rule Compilation<br>>> error File<br>>> com/policy/Rule_SpeCodeSpeValProdPlan12_0.java, Line 12, Column 176:<br>>> Unexpected token "." in primary
<br>>><br>>> ... 7 more<br>>><br>>><br>>> I am using Drools 3.0.6 version.<br>>><br>>> I got the above message when the drl files are added to the<br>>> RuleBase class.
<br>>><br>>> I debugged the code. The error was thrown when<br>>> ruleBase.addPackage(packageBuilder.getPackage()); line was called<br>>> in the<br>>> DroolsExecutor class.<br>>><br>>> Can anyone please suggest me any sollution for this problem.
<br>>><br>>> Thanks in addvance.<br>>><br>>> Thanks,<br>>> McShiv.<br>>> --<br>>> View this message in context: <a href="http://www.nabble.com/Unexpected-">http://www.nabble.com/Unexpected-
</a><br>>> token-%22.%22-in-primary---Rule-Compilation-Error-<br>>> tf4002948.html#a11369488<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>><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>><br>><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Unexpected-token-%22.%22-in-primary---Rule-Compilation-Error-tf4002948.html#a11369670">
http://www.nabble.com/Unexpected-token-%22.%22-in-primary---Rule-Compilation-Error-tf4002948.html#a11369670</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>