create XML rules with XML parser
by Raffaele Viola
Hi all,
I want to create automatically the xml containing the rules using a parser
like castor, which .xsd I have to use to generate the appropriate java
class?
Can someone give me some indications?
Thanks
Raffo
17 years, 1 month
RE: how to find duplicate
by Sikkandar Nawabjan
Hi,
am passing list of objects to working memory. i want to fire the rule if there is any duplicate objects in the list
i write code like this
when
$obj1:Object1($id:id,$name:name)
$obj2:Object1(id==$id,$name:name==$name,this!=$obj1)
then
fire rule
Now the problem lies at this!=objj1(a highlighted check). i put this to avoid a object check with itself.
But this is internally calling equals method of the corresponding object and always return true. Because i overriden equals method in the Object itself
so at the end the rule won't fire even if there is a duplicate object. how i can solve this
equals(Object obj){
if(this.id=obj.id&& this.name==obj.name)
return true;
else
return false;
}
Sikkandar Basha
Tech Lead WPEPDS
UST Global<http://intranet.ustri.com/email/UST-logo.jpg> B5N 144, Bhavani
Technopark, Trivandrum, India
sikkandar.nawabjan(a)ust-global.com <mailto:sikkandar.nawabjan@ust-global.com>
T: +91-471-2335777 Extn: 6802036
M: +91-9946555330
F: +91-471-2527276
________________________________
From: rules-users-bounces(a)lists.jboss.org on behalf of rules-users-request(a)lists.jboss.org
Sent: Tue 11/13/2007 2:04 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 12, Issue 27
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Drools and jBPM integration (Fabian Weisensee)
2. Re: java.lang.OutOfMemoryError: Java heap space (Edson Tirelli)
3. Re: Drools and jBPM integration (Mark Proctor)
4. Re: Drools and jBPM integration (Mark Proctor)
----------------------------------------------------------------------
Message: 1
Date: Mon, 12 Nov 2007 18:23:06 +0100
From: Fabian Weisensee <fabian(a)weisensee.net>
Subject: Re: [rules-users] Drools and jBPM integration
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <47388BFA.3010009(a)weisensee.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Yes, thanks for your help. I'll try your suggestion for #2.
I resolved the deployment problem by myself. It was just a mistake with
the JBoss ESB deploying...
But now I have another problem. The rule file is found, but there seem
to be some problems with the parser.
The FireRulesActionHandler class from the jbpm wiki uses the following code:
RuleBaseImpl ruleBase = new RuleBaseImpl();
ruleBase.addPackage(pkg);
But the RuleBaseImpl class doesn't seem to be part of drools anymore. I
looked at the javadocs to find a replacement. I've found the
RuleBaseLoader class which looked like what I needed. I replaced the two
lines with this:
RuleBaseLoader rbl = RuleBaseLoader.getInstance();
RuleBase ruleBase = rbl.loadFromReader(reader);
ruleBase.addPackage(pkg);
but when I run this I get the following error:
ERROR [GraphElement] action threw exception: Unable to parser Reader
java.lang.RuntimeException: Unable to parser Reader
at org.drools.compiler.DrlParser.getParser(DrlParser.java:209)
at org.drools.compiler.DrlParser.parse(DrlParser.java:60)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:165)
at
org.drools.compiler.RuleBaseLoader.loadFromReader(RuleBaseLoader.java:38)
at
rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:92)
at
rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:49)
Of course I thought my rule file would be syntacticaly incorrect, but
even this rule file didn't work:
package rechnung.kontrolle
rule "test rule 1"
when
then
System.out.println("rule fired!");
end
What am I doing wrong? Is RulesBaseLoader the right class?
Are there any other Informations about integrating jBPM and Drools?
--Fabian
Aziz Boxwala schrieb:
> Fabian,
>
> Response to #1: I believe the rule file needs to reside in the root
> directory of the archive/directory of the example application. I have
> not tried that out so not sure.
>
> With Drools 4.0.x, you have the option of having your rules be located
> in the BRMS.
>
> Response to #2: You should be able to do so using one decision-node.
> Associate the rule action handler with either the Before Signal or Node
> Enter event and specify your decision conditions on the transitions out
> of that node..
>
> --Aziz
>
> ----- Original Message ----
> From: Fabian Weisensee <fabian(a)weisensee.net>
> To: rules-users(a)lists.jboss.org
> Sent: Monday, November 12, 2007 7:35:02 AM
> Subject: [rules-users] Drools and jBPM integration
>
> Hi there
>
> I have some questions concerning Drools and jBPM integration.
> I know there is this wiki page:
> http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmAndDrools
> but first it's not really detailed and second does it seem to be outdated.
>
> 1) I changed the FireRulesActionHandler from the wiki to reflect the
> API-changes, that at least it's compileable. In the jBPM process
> definition the rule file is simply passed as parameter like this:
> "/Shipper.drl". To which directory does this relative path apply? So
> where do I have to deploy this rule file? I tried several locations in
> the application server, but even with an absolute path every time
> FireRulesActionHandler tries to read the rule it crashes:
>
> ERROR [GraphElement] action threw exception: null
> java.lang.NullPointerException
> at java.io <http://java.io.Re <http://java.io.re/> >.Reader.<init>(Unknown Source)
> at java.io <http://java.io.In <http://java.io.in/> >.InputStreamReader.<init>(Unknown Source)
> at
> rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:83)
> at
> rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:50)
>
> 2) As I understood the example in the wiki you have to create a node
> which executes the rule and then a decision-node which routes the
> process flow according to the rule results.
> Is it possible to do this with just one node?
> But perhaps I should ask this at the jBPM forums.
>
> Every help would be appreciated. Thanks in advance.
>
> Fabian Weisensee
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
------------------------------
Message: 2
Date: Mon, 12 Nov 2007 16:35:56 -0200
From: "Edson Tirelli" <tirelli(a)post.com>
Subject: Re: [rules-users] java.lang.OutOfMemoryError: Java heap space
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Message-ID:
<e6dd5ba30711121035j634309ebq14f21d73ad68ce36(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Thanks for reporting and providing workaround. I will look into fixing
that.
2007/11/12, vdelbart <delbart.v(a)mipih.fr>:
>
>
> Hello,
>
> I add this 4 lines in my code before the session.dispose() and the problem
> disapear :
>
> session.removeEventListener((WorkingMemoryEventListener)logger);
> session.removeEventListener((AgendaEventListener)logger);
> session.removeEventListener((RuleFlowEventListener)logger);
> session.removeEventListener((RuleBaseEventListener)logger);
>
> regards,
>
> V.
>
>
>
> vdelbart wrote:
> >
> > Good morning,
> >
> > I found a workaround : don't use the WorkingMemoryFileLogger !
> >
> > I create an issue : http://jira.jboss.com/jira/browse/JBRULES-1325
> >
> > regards,
> >
> > V.
> >
> >
> > vdelbart wrote:
> >>
> >> Hello,
> >>
> >> In my tests of the 4.0.3, I have some : java.lang.OutOfMemoryError.
> >>
> >> So, I try a simple test with 10.000 sequential execution of 1 rule with
> >> no context and just a workingmemorylogger and I have the error :
> >> java.lang.OutOfMemoryError: Java heap space
> >>
> >> My code is :
> >>
> >> public class ExecReglesMemotyTest
> >> {
> >>
> >> private static final Reader DRL = new
> >> InputStreamReader(ExecReglesMemotyTest.class
> >> .getResourceAsStream("/rules/exemple.drl"));
> >>
> >> private static final String FICHIER_LOG = "session";
> >>
> >> /**
> >> * @param args
> >> */
> >> public static void main(String[] args)
> >> {
> >> try
> >> {
> >> PackageBuilder builder = new PackageBuilder();
> >> builder.addPackageFromDrl(DRL);
> >> RuleBase ruleBase = RuleBaseFactory.newRuleBase();
> >> ruleBase.addPackage(builder.getPackage());
> >> for (int i = 0; i < 10000; i++)
> >> {
> >> StatefulSession session =
> ruleBase.newStatefulSession();
> >> WorkingMemoryFileLogger logger = new
> >> WorkingMemoryFileLogger(session);
> >> logger.setFileName(FICHIER_LOG);
> >> session.fireAllRules();
> >> logger.writeToDisk();
> >> session.dispose();
> >> }
> >>
> >> }
> >> catch (Exception e)
> >> {
> >> // TODO Auto-generated catch block
> >> e.printStackTrace();
> >> }
> >> }
> >> }
> >>
> >> with this rule (doesn't matter):
> >> #created on: Fri Nov 09 15:48:45 CET 2007
> >> package initPackage
> >>
> >> #list any import classes here.
> >>
> >> rule "ERG9"
> >> when
> >>
> >> then
> >>
> >> end
> >>
> >> I try this in 4.0.1, and it's working (no OutOfMemoryError)
> >>
> >> What's the problem ?
> >>
> >> thanks for any information,
> >>
> >> V.
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tf477...
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071112/1f1c3a7...
------------------------------
Message: 3
Date: Mon, 12 Nov 2007 20:30:14 +0000
From: Mark Proctor <mproctor(a)codehaus.org>
Subject: Re: [rules-users] Drools and jBPM integration
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <4738B7D6.6060306(a)codehaus.org>
Content-Type: text/plain; charset="iso-8859-1"
Aziz Boxwala wrote:
> Fabian,
>
> Response to #1: I believe the rule file needs to reside in the root
> directory of the archive/directory of the example application. I have
> not tried that out so not sure.
We just take a Reader, so the file can be anywhere. In our examples we
tend to put stuff in the classpath as it makes for very easy loading.
>
> With Drools 4.0.x, you have the option of having your rules be located
> in the BRMS.
>
> Response to #2: You should be able to do so using one decision-node.
> Associate the rule action handler with either the Before Signal or
> Node Enter event and specify your decision conditions on the
> transitions out of that node..
>
> --Aziz
>
> ----- Original Message ----
> From: Fabian Weisensee <fabian(a)weisensee.net>
> To: rules-users(a)lists.jboss.org
> Sent: Monday, November 12, 2007 7:35:02 AM
> Subject: [rules-users] Drools and jBPM integration
>
> Hi there
>
> I have some questions concerning Drools and jBPM integration.
> I know there is this wiki page:
> http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmAndDrools
> but first it's not really detailed and second does it seem to be outdated.
>
> 1) I changed the FireRulesActionHandler from the wiki to reflect the
> API-changes, that at least it's compileable. In the jBPM process
> definition the rule file is simply passed as parameter like this:
> "/Shipper.drl". To which directory does this relative path apply? So
> where do I have to deploy this rule file? I tried several locations in
> the application server, but even with an absolute path every time
> FireRulesActionHandler tries to read the rule it crashes:
>
> ERROR [GraphElement] action threw exception: null
> java.lang.NullPointerException
> at java.io <http://java.io.Re <http://java.io.re/> >.Reader.<init>(Unknown Source)
> at java.io <http://java.io.In <http://java.io.in/> >.InputStreamReader.<init>(Unknown
> Source)
> at
> rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:83)
> at
> rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:50)
>
> 2) As I understood the example in the wiki you have to create a node
> which executes the rule and then a decision-node which routes the
> process flow according to the rule results.
> Is it possible to do this with just one node?
> But perhaps I should ask this at the jBPM forums.
>
> Every help would be appreciated. Thanks in advance.
>
> Fabian Weisensee
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071112/51445af...
------------------------------
Message: 4
Date: Mon, 12 Nov 2007 20:33:59 +0000
From: Mark Proctor <mproctor(a)codehaus.org>
Subject: Re: [rules-users] Drools and jBPM integration
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <4738B8B7.2050309(a)codehaus.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Fabian Weisensee wrote:
> Yes, thanks for your help. I'll try your suggestion for #2.
>
> I resolved the deployment problem by myself. It was just a mistake
> with the JBoss ESB deploying...
>
> But now I have another problem. The rule file is found, but there seem
> to be some problems with the parser.
>
> The FireRulesActionHandler class from the jbpm wiki uses the following
> code:
> RuleBaseImpl ruleBase = new RuleBaseImpl();
> ruleBase.addPackage(pkg);
You should read the Drools docuemtation, heck every example we have
shows how to do this, and every example will show
RuleBase ruleBase = RuleBaseFactory.newRuleBase()
ruleBase.addPackage( pkg )
Where the pkg is created from the PackageBuilder class, again this is
all documented with full examples. What you are using, and someone
wrongly documented, was an internal implementation class, you should be
using the interface.
>
> But the RuleBaseImpl class doesn't seem to be part of drools anymore.
> I looked at the javadocs to find a replacement. I've found the
> RuleBaseLoader class which looked like what I needed. I replaced the
> two lines with this:
> RuleBaseLoader rbl = RuleBaseLoader.getInstance();
> RuleBase ruleBase = rbl.loadFromReader(reader);
> ruleBase.addPackage(pkg);
>
> but when I run this I get the following error:
>
> ERROR [GraphElement] action threw exception: Unable to parser Reader
> java.lang.RuntimeException: Unable to parser Reader
> at org.drools.compiler.DrlParser.getParser(DrlParser.java:209)
> at org.drools.compiler.DrlParser.parse(DrlParser.java:60)
> at
> org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:165)
>
> at
> org.drools.compiler.RuleBaseLoader.loadFromReader(RuleBaseLoader.java:38)
> at
> rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:92)
>
> at
> rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:49)
>
>
> Of course I thought my rule file would be syntacticaly incorrect, but
> even this rule file didn't work:
>
> package rechnung.kontrolle
>
> rule "test rule 1"
> when
> then
> System.out.println("rule fired!");
> end
>
> What am I doing wrong? Is RulesBaseLoader the right class?
> Are there any other Informations about integrating jBPM and Drools?
>
> --Fabian
>
>
>
> Aziz Boxwala schrieb:
>> Fabian,
>>
>> Response to #1: I believe the rule file needs to reside in the root
>> directory of the archive/directory of the example application. I have
>> not tried that out so not sure.
>>
>> With Drools 4.0.x, you have the option of having your rules be
>> located in the BRMS.
>>
>> Response to #2: You should be able to do so using one decision-node.
>> Associate the rule action handler with either the Before Signal or
>> Node Enter event and specify your decision conditions on the
>> transitions out of that node..
>>
>> --Aziz
>>
>> ----- Original Message ----
>> From: Fabian Weisensee <fabian(a)weisensee.net>
>> To: rules-users(a)lists.jboss.org
>> Sent: Monday, November 12, 2007 7:35:02 AM
>> Subject: [rules-users] Drools and jBPM integration
>>
>> Hi there
>>
>> I have some questions concerning Drools and jBPM integration.
>> I know there is this wiki page:
>> http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmAndDrools
>> but first it's not really detailed and second does it seem to be
>> outdated.
>>
>> 1) I changed the FireRulesActionHandler from the wiki to reflect the
>> API-changes, that at least it's compileable. In the jBPM process
>> definition the rule file is simply passed as parameter like this:
>> "/Shipper.drl". To which directory does this relative path apply? So
>> where do I have to deploy this rule file? I tried several locations in
>> the application server, but even with an absolute path every time
>> FireRulesActionHandler tries to read the rule it crashes:
>>
>> ERROR [GraphElement] action threw exception: null
>> java.lang.NullPointerException
>> at java.io <http://java.io.Re <http://java.io.re/> >.Reader.<init>(Unknown Source)
>> at java.io <http://java.io.In <http://java.io.in/> >.InputStreamReader.<init>(Unknown
>> Source)
>> at
>> rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:83)
>>
>> at
>> rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:50)
>>
>>
>> 2) As I understood the example in the wiki you have to create a node
>> which executes the rule and then a decision-node which routes the
>> process flow according to the rule results.
>> Is it possible to do this with just one node?
>> But perhaps I should ask this at the jBPM forums.
>>
>> Every help would be appreciated. Thanks in advance.
>>
>> Fabian Weisensee
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 12, Issue 27
*******************************************
17 years, 1 month
Views???
by ...
Hi,
I 'm new to drools and want to see how the views work(The Agenda
View,The Working Memory View,...). I have created a rule project and a
break point at
workingMemory.fireAllRules() line in sample class and debugged it as
drools application. After I have selected the working memory variable
as explained in the documentation and opened the Agenda View or the
other views, I got this message:
java.lang.NoClassDefFoundError:
org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ....
How can I use this views?Did I do something wrong or maybe forget any thing?
thanks in advanced.
M.A
17 years, 1 month
Re: [rules-users] Drools and jBPM integration
by Aziz Boxwala
Fabian,
Response to #1: I believe the rule file needs to reside in the root directory of the archive/directory of the example application. I have not tried that out so not sure.
With Drools 4.0.x, you have the option of having your rules be located in the BRMS.
Response to #2: You should be able to do so using one decision-node. Associate the rule action handler with either the Before Signal or Node Enter event and specify your decision conditions on the transitions out of that node..
--Aziz
----- Original Message ----
From: Fabian Weisensee <fabian(a)weisensee.net>
To: rules-users(a)lists.jboss.org
Sent: Monday, November 12, 2007 7:35:02 AM
Subject: [rules-users] Drools and jBPM integration
Hi there
I have some questions concerning Drools and jBPM integration.
I know there is this wiki page:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmAndDrools
but first it's not really detailed and second does it seem to be
outdated.
1) I changed the FireRulesActionHandler from the wiki to reflect the
API-changes, that at least it's compileable. In the jBPM process
definition the rule file is simply passed as parameter like this:
"/Shipper.drl". To which directory does this relative path apply? So
where do I have to deploy this rule file? I tried several locations in
the application server, but even with an absolute path every time
FireRulesActionHandler tries to read the rule it crashes:
ERROR [GraphElement] action threw exception: null
java.lang.NullPointerException
at java.io.Reader.<init>(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at
rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:83)
at
rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:50)
2) As I understood the example in the wiki you have to create a node
which executes the rule and then a decision-node which routes the
process flow according to the rule results.
Is it possible to do this with just one node?
But perhaps I should ask this at the jBPM forums.
Every help would be appreciated. Thanks in advance.
Fabian Weisensee
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 1 month
Drools and jBPM integration
by Fabian Weisensee
Hi there
I have some questions concerning Drools and jBPM integration.
I know there is this wiki page:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmAndDrools
but first it's not really detailed and second does it seem to be outdated.
1) I changed the FireRulesActionHandler from the wiki to reflect the
API-changes, that at least it's compileable. In the jBPM process
definition the rule file is simply passed as parameter like this:
"/Shipper.drl". To which directory does this relative path apply? So
where do I have to deploy this rule file? I tried several locations in
the application server, but even with an absolute path every time
FireRulesActionHandler tries to read the rule it crashes:
ERROR [GraphElement] action threw exception: null
java.lang.NullPointerException
at java.io.Reader.<init>(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at
rechnung.kontrolle.FireRulesActionHandler.readRule(FireRulesActionHandler.java:83)
at
rechnung.kontrolle.FireRulesActionHandler.execute(FireRulesActionHandler.java:50)
2) As I understood the example in the wiki you have to create a node
which executes the rule and then a decision-node which routes the
process flow according to the rule results.
Is it possible to do this with just one node?
But perhaps I should ask this at the jBPM forums.
Every help would be appreciated. Thanks in advance.
Fabian Weisensee
17 years, 1 month
How to define Enum in the decision table
by wyf
hi all:
In my tests of the 4.0.3,How can I define java1.5 Enum In the Excel decision table as a condition?
I have a enum like this:
public enum JobStatus {
UNEMPLOYED,EMPLOYED,RETIRED
}
I know i have to get a rule like this:
rule "EMPLOYED test"
no-loop true
when
$moneys:List()
$person:Person(jobstatus == JobStatus.EMPLOYED)
then
System.out.println( "EMPLOYED"+$person.getName());
$moneys.add(new Money(2));
retract($person);
end
I have Tryed define condition like JobStatus.EMPLOYED, EMPLOYED,"EMPLOYED", but nothing work!
I found JobStatus.EMPLOYED was convert to
$person:Person(jobstatus == "JobStatus.EMPLOYED")
buy the SpreadsheetCompiler
So, I Guess the decision table does not support java1.5 Enum??
thanks for any information
tobato
----------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Group Ltd., its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.
-----------------------------------------------------------------------------------------------
17 years, 1 month
Rules for Hierarchical Type Calculation Formulas
by Don Cameron
We have been using a custom rules engine successfully for our 1000+
rules for our student loans application, but these rules are decision
based types rules (if then else).
For assessing loan amounts for our student loan application, we have
over 400+ calculation formulas plus decision logic. These formulas are
mostly simple:
TotalEligilbleLoanAmount = Min(TotalNeed - TotalResource,
MaxAllowedAmount)
TotalNeed = Tuition + LivingAllowance + ChildCareExpenses
ChildCareExpenses = NumberOfChildren * PerChildAmount
TotalResource = EmploymentEarnings + Scholarships + Assets
(however there are 400+ formulas and the hierarchy gets up to 20 deep)
Is it possible to implement something like this in Drools? Will it be
maintainable and performant?
Thanks
Don
This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal, and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed.
17 years, 1 month
compound LHS error, getting "Parser error. Contact Dev Team"
by Eric Miles
I have a compound LHS statement that is causing the parser to fail.
Here is my exact stacktrace:
org.drools.compiler.DroolsParserException: Unknown error while parsing.
This is a bug. Please contact the Development team.
at org.drools.compiler.DrlParser.compile(DrlParser.java:183)
at org.drools.compiler.DrlParser.parse(DrlParser.java:61)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:165)
at
com.kronos.webta.service.security.access.rules.WriteRestrictionsRulesTest.setUpBeforeClass(WriteRestrictionsRulesTest.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
This is the statement that is causing me problems:
not(UserRole((role == Role.TIMEKEEPER, delegateFor == $supId) || (role
== Role.SUPERVISOR, delegateFor == $tkpId)) from $actorRoles)
Remote out one of the conditions from the ||, it compiles fine. Such
as:
not(UserRole(role == Role.SUPERVISOR, delegateFor == $supId) from
$actorRoles)
or
not(UserRole(role == Role.TIMEKEEPER, delegateFor == $tkpId) from
$actorRoles)
Is my syntax incorrect or is there a bug?
Thanks!
17 years, 1 month
Can a rule be assigned both agenda-group and ruleflow-group ?
by LNguyen
Hi everybody:
I would like to use Drools to capture validation logics that will be shared
at UI level and back-end level. That is, I need to fire a specific rule
on-demand to validate a field input and fire it again as part of the final
validation.
To fire a specific rule, I use the agenda-group attribute. To fire it again
as part of a larger group, I then try to create a ruleflow.
I found that if I add a ruleflow-group to a rule, it's can no longer be
fired by setFocus(). Is that normal, or I did something wrong? I thought
of creating a ruleflow for each rule, but that sounds like a hack to me,
Drools probably offer a more elegant solution (I'm only 2 wks into Drools).
What is best way to implement my problem: to fire a rule individually and to
fire it again as part of a group?
TIA
Linh
--
View this message in context: http://www.nabble.com/Can-a-rule-be-assigned-both-agenda-group-and-rulefl...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month