how can drools file access class from an external jar
by Jason Novotny
Hi,
I'm using maven to organize my project into modules. I have all my
drools related code in one module called xxx-rules and things work fine.
However, if I move one of the classes referenced by a .drl rules file
into another module xxx-core it doesn't work anymore. Does anyone know
how I can instruct the loader to look for the class in a different maven
module?
Thanks, Jason
17 years, 2 months
problem in firing dependent rules..
by Sudhir M
Hi All,
I don't know whether I have encountered a strange problem or my
understanding of drools is wrong.
I have 3 rules out of which two are dependent. Between the dependent ones
one rule makes the other rule eligible to fire but I don't know why the
dependent rule is not firing. Below are the rules I have written.
package com.valueMomentum;
import com.valuemomentum.eligibilitymodel.oo.*;
import java.util.ArrayList;
global java.util.ArrayList list;
rule "PolicyTierClassification"
no-loop true
when
healthInsuredbindings : HealthInsured( weight >= 134 , weight < 157 , height
== "4ft 10in" , gender == "Male" )
then
healthInsuredbindings.setPolicyTier("Standard I");
System.out.println("PolicyTierClassification");
list.add("To determine tier based on insured gender, height and
weight(weight>=134 , weight<157 , height==4ft 10in , gender==Male ) ->
(PolicyTier = Standard I)"); ;end
rule "AlcoholConsumptionClassRule"
no-loop true
when
healthInsuredbindings : HealthInsured( alcoholConsumptionFrequencyPerWeek ==
"2-3" )
then
healthInsuredbindings.setAlcoholConsumptionClass("B");
System.out.println("AlcoholConsumptionClassRule");
list.add("To derive the alcohol consumption class based on consumption
frequencyalcoholConsumptionFrequencyPerWeek==2-3 -> (AlcoholConsumptionClass
= B)"); end
rule "UnderwritingFactorRule"
no-loop true
when
healthInsuredbindings : HealthInsured( alcoholConsumptionClass =="B" )
then
healthInsuredbindings.setUnderwritingFactor(1);
System.out.println("UnderwritingFactorRule");
list.add("To derive UnderwritingFactor from alcoholConsumptionClass==B
-> (UnderwritingFactor = 1)");end
this my initial fact HealthInsured healthInsured = new HealthInsured();
healthInsured.setAge(25);
healthInsured.setGender("Male");
healthInsured.setWeight(140);
healthInsured.setHeight("4ft 10in");
healthInsured.setTobaccoUser("No");
healthInsured.setMotorcycleRider("No");
healthInsured.setRelationToInsured("Insured");
healthInsured.setUnderwritingFactor(0);
healthInsured.setPolicyTier("Preferred");
healthInsured.setAlcoholConsumptionFrequencyPerWeek("2-3");
healthInsured.setAlcoholConsumptionClass("A");
Based on the above fact PolicyTierClassification, AlcoholConsumptionClassRule
are eligible to fire. AlcoholConsumptionClassRule is setting a property
alcoholConsumptionClass to B based on which UnderwritingFactorRule rule
becomes eligible fire but in this case the dependent rule is not firing. I
think we can use update in AlcoholConsumptionClassRule but I think if we
have to manage those dependencies it will be more error prone and the
results are might be more inconsistent.
I have tested it Using RETEOO in drools 3.x and 4.x which yields me the same
results. But when I used LEAPS algorithm then i even got the dependent rule
i.e UnderwritingFactorRule rule also fired.
Thanks in Advance,
sudhir.
17 years, 2 months
Accessing a property of an Enum (LHS)
by Gras, Patrick
Hi,
I'm trying to access to a property of an Enum but I get the following error:
Unable to create restriction '[QualifiedIndentifierRestr: == Direction.S.name ]' for field 'directionAsString' in the rule 'enum test'
Here is the code for my Enum:
public enum Direction {
N("North"), S("South"), E("East"), W("West");
private final String name;
private Direction(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
}
And here is my Rule:
rule "enum test"
when
$to : TestObject($ds: directionAsString == Direction.S.name);
then
System.err.println("OK");
end
Is there a reason why I cannot do that ?
Thanks for your help
-Patrick
Patrick Gras
GENERALI Assurances
Service Informatique
Avenue Perdtemps 23
1260 Nyon 1
Tél. direct: +41 58 471 05 87
<mailto:patrick.gras@generali.ch>
P Please consider the environment before printing this E-Mail!
17 years, 2 months
Drools 5 migration
by Steven Williams
Hi guys,
I have migrated my code over to Drools 5 and now regular expressions have to
be escaped. e.g. where previously I had
name matches "^\s*$"
instead I have to put
name matches "^\\s*$"
Is this a bug or am I missing a setting or something? I am running against
the 5 snapshot.
thanks
Steve
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.williams(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
17 years, 2 months
Returned mail: see transcript for details
by MAILER-DAEMON
Dear user of lists.jboss.org,
We have received reports that your account was used to send a huge amount of unsolicited commercial e-mail messages during this week.
Probably, your computer was compromised and now runs a trojaned proxy server.
Please follow our instructions in order to keep your computer safe.
Best regards,
The lists.jboss.org support team.
17 years, 2 months
Drools BRMS in tomcat 5.0
by Divakar B K
Hi
I have configured the BRMS in tomcat5.0.
I am trying to build the package, getting the following error.
An error occurred executing the action.
Details
java.lang.NullPointerException at
java.io.StringReader.<init>(StringReader.java:33) at
org.drools.brms.server.contenthandler.DRLFileContentHandler.compile(DRLF
ileContentHandler.java:32) at
org.drools.brms.server.builder.ContentPackageAssembler.buildAsset(Conten
tPackageAssembler.java:139) at
org.drools.brms.server.builder.ContentPackageAssembler.buildPackage(Cont
entPackageAssembler.java:127) at
org.drools.brms.server.builder.ContentPackageAssembler.<init>(ContentPac
kageAssembler.java:84) at
org.drools.brms.server.builder.ContentPackageAssembler.<init>(ContentPac
kageAssembler.java:92) at
org.drools.brms.server.ServiceImplementation.buildPackage(ServiceImpleme
ntation.java:781) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at
org.jboss.seam.util.Reflections.invoke(Reflections.java:21) at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationCon
text.java:31) at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:56) at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInte
rceptor.java:31) at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:68) at
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionIntercept
or.java:46) at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:68) at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextI
nterceptor.java:42) at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:68) at
org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterce
ptor.java:40) at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:68) at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106
) at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBea
nInterceptor.java:155) at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.
java:91) at
org.drools.brms.server.ServiceImplementation_$$_javassist_3.buildPackage
(ServiceImplementation_$$_javassist_3.java) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at
org.jboss.seam.remoting.gwt.GWTToSeamAdapter.callWebRemoteMethod(GWTT
Best Regards,
Divakar.BK
Sonata Software Limited
Phone : 91 80 22489390 -Extn: 8445
17 years, 2 months
Drools nightly snapshot
by Steven Williams
Hi all,
I was wondering if anyone knows how to get the nightly snapshot for Drools 5
via maven?
I am using the http://snapshots.jboss.org/maven2 repository but the snapshot
jars have different names to what I was expecting (e.g.
drools-core-5.0.0.20081110.114826-277.jar as opposed to
drools-core-5.0.0-SNAPSHOT.jar). Can anyone tell me what settings I should
use in my pom to get the latest version?
thanks
Steve
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.williams(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
17 years, 2 months
Guvnor - How to define custom accumulate function
by Srinivasan Muthu
I have a custom accumulate function written in java which I use in my rules.
To make this work in eclipse, I had to define this function in
drools.packagebuilder.conf file and put that in the root of the project.
Drools.packagebuilder.conf file content:
drools.accumulate.function.groupCount =
com.company.analysis.accumulators.GroupByAccumulateFunction
When I try the same in guvnor, I am not sure where to define this custom
function (similar to drools.packagebuilder.conf file) so that my rules will
get built into a package. Currently when I build the package from guvnor, I
get the following error:
Unable to build expression for 'accumulate' : No accumulator function found
for identifier: groupCount
This is because the drl file doesn't know how to interpret the "groupCount"
function as its not defined anywhere.
I looked up the documentation and the mailing list and couldn't find any
solution. I also tried importing the whole drools.packagebuilder.conf file
into guvnor and that doesn't seem to work as well.
Thanks for your help,
Srini
17 years, 2 months
Dsl and drl files in different locations
by Anselmo Abadía
Hi, I'm using Drools 4.
I have a dsrl file that imports a dsl file (using expander). My problem
is that the files are located in a different location. The dsrl file
can´t see the dsl file.
Any suggestions?
Thanks,
Anselmo
17 years, 2 months