"From" in decision table
by Bruno Freudensprung
Hi guys,
As you have probably noticed, today is my "decision tables day" :-).
Before telling you what is going wrong, let me show you what kind of
rule I try to put in my Drools 5.1 decision table:
# for each window
$window : Window($elements : elements) from $windows
# for each manual annotation
$an1 : ManualAnnotation( this inside $window && text ==
*"ToMatch"*)
# if there is another manual annotation
exists ManualAnnotation( this inside $window && text ==
*"ToMatch2"*)
The only things I would like to parametrize are strings in bold.
My decision table looks like this:
CONDITION CONDITION CONDITION
CONDITION CONDITION
$an1 : ManualAnnotation
exists ManualAnnotation
$window : Window($elements... this inside $window
text == "$1"
this inside $window text == "$1"
for each window
annotation inside window
Text annotation inside window Text
N/A N/A ToMatch
N/A ToMatch2
N/A N/A ToMatch3 N/A ToMatch4
Here are the problems (in bold) with the generated rule:
$an1 : ManualAnnotation( *this inside $window == "N/A"* && text
== *"*ToMatch*"*)
exists ManualAnnotation( *this inside $window == "N/A"* && text
== *"*ToMatch2*"*)
*$window : Window($elements : elements) from $windows*
* The order of the LHS "fact lines" of the generated rules is the
not same as the order of appearance in the spreadsheet
* The "this inside $window" is considered as a field name
Do you know if I can solve those problems?
I have tried to find a way to tell the decision table to extend another
rule but I haven't found a keyword for that in the documentation.
Maybe do I have to use rule templates?
Many thanks,
Best regards,
Bruno.
14 years, 7 months
Classloading error with AspectJ and Drools 5.2.0.Final
by Steven Williams
Hi,
I have just upgraded to Drools 5.2.0.Final and am getting a weird error when
running unit tests.
java.lang.NullPointerException
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
ClassLoaderWeavingAdaptor.java:251)
at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
DefaultWeavingContext.java:130)
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
ClassLoaderWeavingAdaptor.java:161)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
Aj.java:271)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
Aj.java:276)
at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)
at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)
at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
ClassPreProcessorAgentAdapter.java:54)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365
)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
JavaDialectRuntimeData.java:570)
at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:258)
at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:241)
at org.drools.util.CompositeClassLoader.loadClass(
CompositeClassLoader.java:88)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:405)
at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:396)
at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
JavaDialectRuntimeData.java:237)
at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
DialectRuntimeRegistry.java:132)
at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:360)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(
PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(
KnowledgeBuilderImpl.java:28)
at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
KnowledgeBaseBuilder.java:108)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:69)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:54)
I have traced the problem to org.drools.rule.
JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
whereas AspectJ expects it to at least return an empty enumeration - hence
the NPE. Interestingly the problem does not occur when running our server,
however we can't upgrade unless our unit tests pass and we can't easily turn
off aspectj for these.
regards
Steve
14 years, 7 months
Re: [rules-users] [rules-dev] Building a (semantic) application
by Wolfgang Laun
This list is dedicated to the communication between Drools developers.
For general questions about Drools and rules, please use the "Rules Users
List" <rules-users(a)lists.jboss.org>, which has a much wider audience.
-W
On 7 September 2011 03:56, Sebastian Samaruga <cognescent(a)gmail.com> wrote:
> Question,
>
>
14 years, 7 months
Druplicate rule name: 0
by bitter
I have 100 rules in xls decision table.
I modify any rule and save change. Then I try to build create new knwoledge
base using this file and I have exception:
java.lang.RuntimeException: [784,0]: Duplicate rule name: 0
[801,0]: Duplicate rule name: 0
[818,0]: Duplicate rule name: 0
[837,0]: Duplicate rule name: 0
[856,0]: Duplicate rule name: 0
[873,0]: Duplicate rule name: 0
[890,0]: Duplicate rule name: 0
[907,0]: Duplicate rule name: 0
[924,0]: Duplicate rule name: 0
[941,0]: Duplicate rule name: 0
[958,0]: Duplicate rule name: 0
[975,0]: Duplicate rule name: 0
[992,0]: Duplicate rule name: 0
[1009,0]: Duplicate rule name: 0
I tried to compile this file using SpreadSheetCompiler. This is a scrap of
drl file wth rules:
*
# rule values at A52, header at A5
rule "0"
salience 60
ruleflow-group "0"
when
*
--
View this message in context: http://drools.46999.n3.nabble.com/Druplicate-rule-name-0-tp3246425p324642...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
encounter NullPointerException when adding ruleflow
by James Yu
Hi all,
I tried to run Drools in a webapp, it runs smoothly when I only load simple
rules.
The spec I have:
AP server --> WASCE2.1 (or geronimo 2.1)
Spring --> 3.0.5
Drools --> 5.2 Fianl
JVM --> IBM SDK 1.6
When I tried to use ruleflow --> execute drl in rf, I got
NullPointerException with the following trace:
exception
org.springframework.web.util.NestedServletException: Request processing
failed; nested exception is java.lang.NullPointerException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
root cause
java.lang.NullPointerException
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:516)
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:556)
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
net.viralpatel.drools.core.DroolsCore.createKnowledgeBase(DroolsCore.java:17)
net.viralpatel.contact.controller.ContactController.listContacts(ContactController.java:41)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:59)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:39)
java.lang.reflect.Method.invoke(Method.java:612)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
net.viralpatel.drools.core.DroolsCore.createKnowledgeBase(DroolsCore.java:17)
is the following line:
builder.add(ResourceFactory.newClassPathResource("basicFlow.rf"),
ResourceType.DRF);
Any advise is appreciated.
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
14 years, 8 months
Re: [rules-users] rules-users Digest, Vol 58, Issue 17
by James Yu
>
> Are you sure that basicFlow.rf is in your classpath correctly?
>
I am sure that I have both "basicRule.drl" and "basicFlow.rf" files in
classpath as they are located in "WEB-INF\classes"
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
14 years, 8 months
is null or is not Null failing for a String field check in Guvnor drl
by puja nandamuri
Hi ,
when using a business rule guided editor ,
for a fact, when I select a string type field from the drl guided editor in Guvnor and select
is null from the dropdown list of operators,
I get the following validation error when I do a validate on the rule.
no viable alternative at input 'null' in rule "Asset_Description_NullCheckRule"
when I do a View Source, it shows the source as
when
Asset( description == null null )
Is this a bug ?
if I select the free form drl option and create the when condition as
Asset( description == null ) , it validates fine.
Thanks,
Ram
14 years, 8 months
Rules Fest Last Minute Medical Meetup Speakers Wanted
by Mark Proctor
Rules Fest is very close (24-28th of October, San Francisco) and this
year RHT are sponsoring the bootcamps to a high level to ensure that
they are made freely available to all.
http://rulesfest.org/html/home.html
Thu the 27th will follow the normal intro format as previous years,
along with time to ask questions of core developers.
At the last minute budget was found for an additional day on Friday the
28th. Due to the success of the healthcare meet up in San Diego 2010
<http;//community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010>, we
would like to try and dedicate this day to healthcare.
We would like this day to be 100% community presented, by real
practitioners. If you are doing anything interested in the area of
healthcare related to rules, workflow, events, ontologies, distributed
intelligent agents and would like to talk, please contact me asap:
mproctor at codehaus d0t org.
The talks do not need to be Drools specific, but it should be relevant
to any one looking to do Open Source based technology implementations of
the previously mentioned areas. Applied, theoritcal and technical talks
are all welcome.
Again sorry for the last minute notice, but hopefully we can still make
this into a great community oriented day.
Mark
Drools Project Lead and Co-creator
14 years, 8 months
where is drools-api jar file located for 5.2 final ?
by James Yu
Hi all,
I just downloaded and decompress "drools-distribution-5.2.0.Final", I only
find
drools-core-5.2.0.Final.jar
drools-compiler-5.2.0.Final.jar
I am unable to find "drools-api-5.2.0.Final.jar"
Does anyone know where is it located ?
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
14 years, 8 months