Doubt regarding split in Drools rule-flow
by bjs
Hello everyone,
I have ruleflow with a split that seggregates objects with balance less
than 5000(branch1) and more than and equal to 5000(branch2) and series of
rules in each of the branch.
But when i run the flow for multiple objects , if an objects with balance
less than 5000(branch1) matches the rule under the branch2 it fires the
rule.
How do i segregate based on the split and make the objects fire rules only
under branch1 if it satisfies the condition for branch1.
--
View this message in context: http://drools.46999.n3.nabble.com/Doubt-regarding-split-in-Drools-rule-fl...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
DROOLS-516 - Continued Memory Leak problem Drools 6.1.0.
by Kent Anderson
It appears there is another condition where Drools holds onto memory indefinitely. (See https://issues.jboss.org/browse/DROOLS-516)
Use case: We have a set of rules designed to detect a heartbeat, then report when/if the heartbeat stops.
Problem: In the normal case of a constant heartbeat, memory is retained in the JVM, even though the fact count in working memory is 1.
The following rules produce this problem. I have attached a test project that demonstrates this problem. 600K events are inserted into the stream, then the test driver waits. After 10 seconds, the “absence detected” rule fires. Requesting a GC via JMC has no effect. If you hit a key while the test driver is waiting, a new event will be added, which will cause the “clear absence alarm” rule to fire. At this point some memory is freed automatically. Requesting another GC removes all memory and the JVM is back in its (nearly) new condition.
We consider this a memory leak since the events are gone from working memory and will no longer be considered in any rule evaluations, but they are still active somewhere in the JVM.
package org.drools.example.api.kiemodulemodel
import demo.Event
declare Event
@role( event )
@timestamp( timestamp )
end
declare Heartbeat
@role( event )
@timestamp( event.timestamp )
event : Event
end
declare AbsenceDetected
name : String
end
/*
* This rule matches the first event
*
* NOTE: This stream requires the heartbeat event
* to occur at least once before absence will be detected.
*/
rule "detect first heartbeat"
when
$event : Event()
not ( Heartbeat() )
then
delete($event);
insert(new Heartbeat($event));
System.out.println("[DFH] Got event: " + $event.getEventId());
end
/*
* This rule matches every event and stores only the most recent
* as the heartbeat.
*/
rule "keep latest heartbeat"
when
$heartbeat : Heartbeat()
$event : Event()
then
delete($heartbeat);
insert(new Heartbeat($event));
System.out.println("[KLH] Got event: " + $event.getEventId());
delete($event);
end
/*
* This rule detects when a heartbeat stops for 10s
*/
rule "detect absence"
duration(10s)
when
$heartbeat : Heartbeat()
not ( Event() )
not (AbsenceDetected() )
then
delete($heartbeat);
insert(new AbsenceDetected("Absence"));
System.out.println("[DA] Absence detected");
end
/*
* This rule detects when the heartbeat starts again after
* absence has been detected.
*/
rule "clear absence alarm"
when
$heartbeat : Heartbeat()
$absence : AbsenceDetected ()
then
delete($absence);
System.out.println("[CAA] Heartbeat restored");
end
11 years, 7 months
Problem with Drools 6.0.1 Eclipse Projects with CDI and Java 7
by WebHomer
I'm new to Drools and pretty new to maven. I am trying to incorporate Drools
6.0.1 into a Wildfly (8.0.0) based project. I am using the current version
of JBoss Developer Studio 7.1.1.GA on Redhat Linux In Eclipse the project
has a number of errors in CDI modules, but builds without errors in maven.
The Java auto-complete works correctly as I import annotations, but after is
is imported I get an error in the file showing
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
The above all show the same type of error:
Only a type can be imported. javax.enterprise.inject.Disposes resolves to a
package
It seems to be limited to the javax cdi includes
This is a maven project, and maven compiles it with no problems. Only
Eclipse seems to have an issue.
I have m2eclipse installed as well.
In addition, if I use Java 7 syntax extensions it complains about those too.
The maven pom specifies Java 1.7, the project facets specifies 1.7 and the
default compliance level is also Java 1.7. But something somewhere doesn't
like it. Again, a maven build works. Only Eclipse has problems. I suspect
the Eclipse Drools plugin may be at fault as I don't see this in non-Drools
projects
I see this in the standard Java files, not the .drl files. It is quite
annoying and frustrating. We have to build using only maven
I found that this can be easily reproduced. You need m2eclipse installed,
and the drools 6.0.1.Final eclipse plugin installed
1. In Eclipse create a new drools project
2. Convert the project to maven
3. add the javax.enterprise:cdi-api (version 1.1) dependency
4. Maven>Update Project
5. edit a java file in the project and try to add one of the above listed
imports and you will see the same error.
I believe that this is also related:
I set my pom.xml to java 7, verified that the project was java 7 compliance
etc and the eclipse editor still complained about the use of Java 7 features
like the "diamond" operator.
It seems that Drools doesn't like Eclipse and Java 7...
<http://drools.46999.n3.nabble.com/file/n4030485/EclipseErrors.png>
--
View this message in context: http://drools.46999.n3.nabble.com/Problem-with-Drools-6-0-1-Eclipse-Proje...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
gradle and drools
by Mercier Jonathan
Dear,
Gradle become day after day more popular. In more spring and hibernate
project switch to this tools. So how we can use this tools with drools
to get an uniform build system ?
Regards
11 years, 7 months
Drools Performance Analysis Required
by Zahid Ahmed
Hi,
I need to know the Drools capacity to execute the rules.
I need to know how many rules it can execute at a time and with how many facts.
I need to know the memory stats.
We are planning for a central rules execution server with executing around 10,000 rules per request and requests per minute can be ~300.
Has anyone done the benchmarking. Or is there any scalable solution that can be implemented.
11 years, 7 months
Unable to build index of kmodule.xml from Kie project jar
by Sumit Dhaniya
I'm trying to use the Kie jar in my spring project. It successfully
identifies the Kie jars in my project but give errors listed below :-
INFO ClasspathKieProject - Found kmodule:
jar:file:/C:/Users/Sumit%20Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar!/META-INF/kmodule.xml
ERROR ClasspathKieProject - Unable to load pom.properties
from/C:/Users/Sumit
Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar as jarPath
cannot be found
/Users/Sumit Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar
ERROR ClasspathKieProject - Unable to load pom.properties
from/C:/Users/Sumit
Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar
\Users\Sumit Dhaniya\.m2\repository\com\demo\FirstDemo\1.0\FirstDemo-1.0.jar
(The system cannot find the path specified)
ERROR ClasspathKieProject - Unable to build index of kmodule.xml
url=jar:file:/C:/Users/Sumit%20Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar!/META-INF/kmodule.xml
Even if I define kie modules and sessions in my conf file I can't access the
drl and rdrl files in my Kie Project.
Though if I create my objects using
kieServices.getResources().newUrlResource(url); everything works fine.
--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-build-index-of-kmodule-xml-fr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
How to read XML using XMLPackageReader-Drools-compiler.5.2.1.final?
by Praveen
Hi,
I am using Drools-compiler.5.2.1.final.
I am trying to convert an drl to xml and vice versa using DrlParser,
DrlDumper, XMLPackageReader and XML Dumper.
Drl to XML conversion works fine but XML to Drl throws NPE.
I have placed the XML file under a folder called sample.
NPE is thrown at line 5..
Also attached is the exception.
Please suggest.
TIA.
Reader source = new InputStreamReader(
DroolsConversionHelper.class.getResourceAsStream(xmlFileName));
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
XmlPackageReader reader = new
XmlPackageReader(conf.getSemanticModules());
DrlDumper dumper = new DrlDumper();
//line 5 reader.read(source);
PackageDescr descr = reader.getPackageDescr();
String test = dumper.dump(descr);
System.out.println(test);
java.lang.NullPointerException
at
org.drools.xml.ExtensibleXmlParser.resolveSchema(ExtensibleXmlParser.java:696)
at
org.drools.xml.ExtensibleXmlParser.resolveEntity(ExtensibleXmlParser.java:622)
at
com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
Regards,
Praveen.
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-read-XML-using-XMLPackageReader-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Processing xml with control characters in droolserver
by Shameer E S
Hi,
I am sending xml to initiate rule execution in drools server 5.4. When
there is control character in the xml, it is failing with following error,
is there any way to overcome this?
16 Jul 2014 00:03:28,852 ERROR
[org.apache.camel.processor.DefaultErrorHandler] (http--0.0.0.0-8080-239)
Failed delivery for exchangeId:
ID-svl-prod-prwf04-juniper-net-51091-1404737660521-0-3260214. Exhausted
after delivery attempt: 1 caught:
com.thoughtworks.xstream.converters.ConversionException: : Illegal
character ((CTRL-CHAR, code 8)) [note: in XML 1.1, it could be included via
entity expansion]
at [row,col {unknown-source}]: [30,126] : : Illegal character
((CTRL-CHAR, code 8)) [note: in XML 1.1, it could be included via entity
expansion]
at [row,col {unknown-source}]: [30,126]
---- Debugging information ----
message : : Illegal character ((CTRL-CHAR, code 8)) [note: in
XML 1.1, it could be included via entity expansion]
at [row,col {unknown-source}]: [30,126]
cause-exception : com.thoughtworks.xstream.io.StreamException
cause-message : : Illegal character ((CTRL-CHAR, code 8)) [note: in
XML 1.1, it could be included via entity expansion]
at [row,col {unknown-source}]: [30,126]
class : java.lang.String
required-type : java.lang.String
converter-type :
com.thoughtworks.xstream.converters.SingleValueConverterWrapper
wrapped-converter :
com.thoughtworks.xstream.converters.basic.StringConverter
path : /batch-execution/set-global[7]/map/entry[50]/string[2]
line number : 2
class[1] : java.util.HashMap
converter-type[1] :
com.thoughtworks.xstream.converters.collections.MapConverter
class[2] : org.drools.command.runtime.SetGlobalCommand
converter-type[2] :
org.drools.runtime.help.impl.XStreamXML$SetGlobalConverter
class[3] : org.drools.command.runtime.BatchExecutionCommandImpl
converter-type[3] :
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : null
Thanks & Regards,
Shameer
11 years, 7 months