<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
eval cannot be indexed and a join must happen before it can be
evaluated, so its a little slower - but there are cases where you can't
avoid using it.<br>
<br>
Mark<br>
Rajesh_Kumar wrote:
<blockquote
cite="mid:0A1C55F22D8A9A4DA278E989137F52180148AE86@rsi-nod-mail5"
type="cite">
<pre wrap="">hi Mark,
Could you please provide us the reasons , why you have written
"eval is evil" in rule writing guidelines.I want to use it in my rules.
Regards
Rajesh Choudhary.
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of
<a class="moz-txt-link-abbreviated" href="mailto:rules-users-request@lists.jboss.org">rules-users-request@lists.jboss.org</a>
Sent: Sunday, July 01, 2007 9:30 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
Subject: rules-users Digest, Vol 8, Issue 1
Send rules-users mailing list submissions to
        <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
To subscribe or unsubscribe via the World Wide Web, visit
        <a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
or, via email, send a message with subject or body 'help' to
        <a class="moz-txt-link-abbreviated" href="mailto:rules-users-request@lists.jboss.org">rules-users-request@lists.jboss.org</a>
You can reach the person managing the list at
        <a class="moz-txt-link-abbreviated" href="mailto:rules-users-owner@lists.jboss.org">rules-users-owner@lists.jboss.org</a>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Unexpected token "." in primary - Rule        Compilation
Error
(McShiv)
2. Help with MR3 (s erel)
----------------------------------------------------------------------
Message: 1
Date: Sat, 30 Jun 2007 15:05:19 -0700 (PDT)
From: McShiv <a class="moz-txt-link-rfc2396E" href="mailto:rajesh_sachin10@yahoo.co.in"><rajesh_sachin10@yahoo.co.in></a>
Subject: Re: [rules-users] Unexpected token "." in primary - Rule
        Compilation Error
To: <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:11377473.post@talk.nabble.com"><11377473.post@talk.nabble.com></a>
Content-Type: text/plain; charset=us-ascii
Hi Michael,
What is vanilla DRL? Can you briefly explain about it?
Thanks,
McShiv
Michael Neale wrote:
</pre>
<blockquote type="cite">
<pre wrap="">hmm.. there is a problem with the action of the 2nd rule, so,
</pre>
</blockquote>
<pre wrap=""><!---->converting
</pre>
<blockquote type="cite">
<pre wrap="">it
to vanilla DRL:
rule "SpeCodeSpeValProdPlan12"
salience 50
when
...
then
if(common.getProd() == "{prodCode1}" || common.getPlan() ==
"{planCode1}"){System.out.println("Error");}
end
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
</pre>
</blockquote>
<pre wrap=""><!---->what
</pre>
<blockquote type="cite">
<pre wrap="">is
causing it. Also - why are you doing the if on the RHS? I would get
</pre>
</blockquote>
<pre wrap=""><!---->rid of
</pre>
<blockquote type="cite">
<pre wrap="">that if at all possible to save confusion later.
On 6/30/07, McShiv <a class="moz-txt-link-rfc2396E" href="mailto:rajesh_sachin10@yahoo.co.in"><rajesh_sachin10@yahoo.co.in></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
DRL Syntax
package com.policy;
expander SpeCodeSpeValProdPlan.dsl;
#list any import classes here.
import com.viking.common.transferbeans.CommonInformation;
import com.sentry.common.entitybeans.EntityBean;
import com.sentry.common.entitybeans.Selected;
import java.util.ArrayList;
import java.util.List;
#declare any global variables here
rule "SpeCodeSpeValProdPlan11"
salience 100
when
The EntityBean Contains Selected List
then
Assert All The Selected
end
rule "SpeCodeSpeValProdPlan12"
salience 50
when
The Question Code Is "License" And The Selected Value is "Y"
then
Remove The Product "09" And Plan "CD"
end
DSL Syntax:
[when] The EntityBean Contains Selected List = entity : EntityBean();
eval(entity.getSelected() != null);
[then] Assert All The Selected = Object[] quoSelList =
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->entity.getSelected
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">();
for(int i = 0; i < quoSelList.length; i++){ Selected queSel =
(Selected)quoSelList[i]; assert(queSel); System.out.println(queSel);
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->}
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">[when] The Question Code Is "{speCode1}" And The Selected Value is
"{speValue1}" = common : CommonInformation();
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->Selected(stateSpecificCode
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">==
"{speCode1}", stateSpecificValue == "{speValue1}");
[then] Remove The Product "{prodCode1}" And Plan "{planCode1}" =
if(common.getProd() == "{prodCode1}" || common.getPlan() ==
"{planCode1}"){System.out.println("Error");}
The Selected Class is an Object Array inside EntityBean Class.
CommonInformation is a seperate class. CommonInformation & EntityBean
will
be available in Working Memory(asserted earlier in java class).
I need to remove the Selected Classes in the Object array and assert
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->into
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">the working memory. Thats what I am doing in the First Rule.
In the Second rule I check for some condition and print the error
according
to the condition.
Thanks,
McShiv
Fernando Meyer Camargo wrote:
</pre>
<blockquote type="cite">
<pre wrap="">howdy,
is your package name right? please paste your rule code.
Fernando Meyer
<a class="moz-txt-link-abbreviated" href="mailto:fmcamargo@gmail.com">fmcamargo@gmail.com</a>
GPG: 5A6D 3374 B055 A513 9A02 A03B 3DB3 7485 D804 DDFB
On Jun 29, 2007, at 10:16 PM, McShiv wrote:
</pre>
<blockquote type="cite">
<pre wrap="">com.package.FatalSystemException
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.reteoo.RuleBaseImpl.addPackage(Unknown Source)
at
com.sentry.underwriting.ruleexecutor.DroolsExecutor.executeRules
(DroolsExecutor.java)
at
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->com.sentry.underwriting.ruleexecutor.RulesExecutionProcessor.callRules
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Executor(RulesExecutionProcessor.java:82)
at
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->com.sentry.underwriting.ruleexecutor.RulesExecutionProcessor.rulesExec
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">utionprocess(RulesExecutionProcessor.java:65)
at
com.sentry.underwriting.ruleprocessor.RulesProcessor.processRules
(RulesProcessor.java)
at
com.sentry.underwriting.test.UnderwritingDemo.main
(UnderwritingDemo.java:21)
Caused by: org.drools.rule.InvalidRulePackage: Rule Compilation
error File
com/policy/Rule_SpeCodeSpeValProdPlan12_0.java, Line 12, Column
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->176:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Unexpected token "." in primary
... 7 more
I am using Drools 3.0.6 version.
I got the above message when the drl files are added to the
RuleBase class.
I debugged the code. The error was thrown when
ruleBase.addPackage(packageBuilder.getPackage()); line was called
in the
DroolsExecutor class.
Can anyone please suggest me any sollution for this problem.
Thanks in addvance.
Thanks,
McShiv.
--
View this message in context: <a class="moz-txt-link-freetext" href="http://www.nabble.com/Unexpected">http://www.nabble.com/Unexpected</a>-
token-%22.%22-in-primary---Rule-Compilation-Error-
tf4002948.html#a11369488
Sent from the drools - user mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<pre wrap="">--
View this message in context:
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!----><a class="moz-txt-link-freetext" href="http://www.nabble.com/Unexpected-token-%22.%22-in-primary---Rule-Compila">http://www.nabble.com/Unexpected-token-%22.%22-in-primary---Rule-Compila</a>
tion-Error-tf4002948.html#a11369670
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Sent from the drools - user mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>