Guvnor test case with fact with Object fields
by mpgong
Hello,
I have a fact that has is also my entity model and it has a field that is a
class called state which holds previous and current state values (enum).
So i have a condition that gets the state and gets the two values to check.
The issue i'm running into is with creating a test case in guvnor, is it
possible to create a test case with a field that is an object like this?
Guvnor recognizes that i have a field called state but it doesn't realize
that it is a class so it doesn't look like i would be able to test any rules
the uses state as a condition check.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-test-case-with-fact-with-Object-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
command line to import repository
by halljme
we have many environments and require the ability to refresh these
environments weekly. this would be much easier to perform via a script/cron
then requiring to perform via manually. Has any thought been put into
creating such or does the ability exist but is just undocumented?
I read a post back on Dec 1, 2009 requesting such ability and as of then,
there was not a way of performing this. I cannot imagine there has not been
any thought or development to perform such a menial task via command line to
enable scripted processes.
If the ability exist via GUI then there has to be some command(s) that exist
to perform an import via command line. At least the logic exists, so the
command should not be to difficult to develop.
respectfully, jme
--
View this message in context: http://drools.46999.n3.nabble.com/command-line-to-import-repository-tp401...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
DRL to XML transformation
by Anirban Bandyopadhyay
Hi,
We have a set of rule files in DRL format. We couldn't find a way (tool) of importing them into Guvnor as BRL file so that we can edit using the designer.
We ended up using the DrlParser and XmlDumper to transform them from DRL to BRL. It produces the XML and when we add it to the repository using WebDav, Guvnor lists the files under Business Rule which is perfect. BUT when I try to open it, it throws the following error:
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$Unkno
wnFieldException: No such field org.drools.ide.common.client.modeldriven.brl.Rul
eModel.rule-attribute
---- Debugging information ----
field : rule-attribute
class : org.drools.ide.common.client.modeldriven.brl.RuleModel
required-type : org.drools.ide.common.client.modeldriven.brl.RuleModel
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionC
onverter
path : /rule/rule-attribute
version : null
-------------------------------
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv
erter.determineType(AbstractReflectionConverter.java:449)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv
erter.doUnmarshal(AbstractReflectionConverter.java:290)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv
erter.unmarshal(AbstractReflectionConverter.java:230)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall
er.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A
bstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
arshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
arshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller
.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh
al(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:886)
at org.drools.ide.common.server.util.BRXMLPersistence.unmarshal(BRXMLPer
sistence.java:191)
at org.drools.guvnor.server.contenthandler.drools.BRLContentHandler.retr
ieveAssetContent(BRLContentHandler.java:41)
at org.drools.guvnor.server.RepositoryAssetService.handlePackageItem(Rep
ositoryAssetService.java:132)
at org.drools.guvnor.server.RepositoryAssetService.loadRuleAsset(Reposit
oryAssetService.java:118)
at org.drools.guvnor.server.RepositoryAssetService$Proxy$_$$_WeldClientP
roxy.loadRuleAsset(RepositoryAssetService$Proxy$_$$_WeldClientProxy.java)
at org.drools.guvnor.server.RepositoryServiceServlet.loadRuleAsset(Repos
itoryServiceServlet.java:403)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:5
69)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(Remot
eServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(Remot
eServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(Ab
stractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso
r.java:877)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
ocess(Http11AprProtocol.java:594)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:16
75)
at java.lang.Thread.run(Thread.java:662)
I am able to re-produce the same error when I try to convert the BRL to DRL using BRDRLPersistence and BRXMLPersistence marshalling and unmarshalling. I checked that the field 'rule-attribute' is indeed not present in org.drools.brms.client.modeldriven.brl.RuleModel. when I look at the example brl file from the sample mortgage, they don't have 'rule-attribute', and it's not only that specific node, the whole set of node names are different.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public void convertDrlToBrl() throws IOException, DroolsParserException {
Resource fileResource = new ClassPathResource("Beneficiary_User_KYC_Level_3_Daily_Limit.drl");
DrlParser parser = new DrlParser();
XmlDumper dumper = new XmlDumper();
Reader source = new InputStreamReader(new FileInputStream(fileResource.getFile()));
PackageDescr pkg = parser.parse(source);
String xmlString = dumper.dump(pkg);
System.out.println(xmlString);
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public void convertBrlToDrl() throws IOException {
Resource fileResource = new ClassPathResource("Beneficiary_User_KYC_Level_3_Daily_Limit_BRL.brl");
String fileAsString = FileUtils.readFileToString(fileResource.getFile());
BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance();
BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance();
RuleModel ruleModel = read.unmarshal(fileAsString);
String outputDRL = write.marshal(ruleModel);
System.out.println(outputDRL);
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Generated xml file:
===============================================
<rule name="Beneficiary_User_KYC_Level_3_Daily_Limit_BRL">
<rule-attribute name="dialect" value="mvel" />
<lhs><pattern object-type="UserBean" >
<field-constraint field-name="kycLevel">
<literal-restriction evaluator="==" value="KYC_LEVEL_3" />
</field-constraint>
<field-constraint field-name="userType">
<literal-restriction evaluator="==" value="BENEFICIARY" />
</field-constraint>
</pattern>
<pattern object-type="Activity" >
<field-constraint field-name="type">
<literal-restriction evaluator="!=" value="TRANSACTION.SEND" />
</field-constraint>
</pattern>
</lhs><rhs> Limit fact0 = new Limit();
fact0.setType( "DAILY_TRANSACTION_LIMIT" );
fact0.setValue( 10000 );
fact0.setErrorMessage( "Maximum daily total amount of N10,000 exceeded for {0}." );
insert(fact0 );
</rhs>
</rule>
================================================
Am I doing something wrong? Is there a better way of converting the DRLs to BRLs?
Thanks in advance!
Anirban Bandyopadhyay
________________________________
This message contains confidential and proprietary information of the sender, and is intended only for the person(s) to whom it is addressed. Any use, distribution, copying, disclosure or taking of any action in reliance upon it by any other person is strictly prohibited. If you have received this message in error, please notify the e-mail sender immediately, and delete the original message without making a copy.
The Monitise group comprises: Monitise plc (Reg. No. 6011822), Monitise Group Limited (Reg. No. 5590897), Monitise International Limited (Reg. No. 5556711) and Monitise Europe Limited (Reg. No. 4831976). These companies are registered in England and Wales and their registered office address is: Warnford Court, 29 Throgmorton Street, London, EC2N 2AT United Kingdom.
13 years, 9 months
Drools integration with Spring
by Ini
Hi All,
I am new to drools and have some how got through my previous
issue of updating user defined error object with details.
I need help in following items:
1. how to integrate the drools with my Spring application.
2. I have a scenario like i need to write different rules file for different
beans ... say i have two beans (Employee, Department) to validate for which
i have written two rules file say EmployeeRule.drl and DepartmentRule.drl
files. i have a common method where i am passing the object(either employee
or Department) that need to be checked. In this case how will i add
different drl file in KnowledgeBuilder.
Like to validate Employee bean i need to add EmployeeRule.drl file and to
validate Department bean i need to add DepartmentRule.drl file.
Hope i am making some sense here..
thanks,
Ini
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-integration-with-Spring-tp397301...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Function calls in decision table
by San
Hi
I am trying to cal a local function getMaturityAge() in the decision table
condition column like
RuleTable MaturityAge Validation
CONDITION
ACTION
pp:PremiumCalculatorFormBean
getMaturityAge() > "$1"
System.out.println("invalid maturity age");
Premium Payment Term Print out
message?
70 X
The method is defined localy using functions key word.
And moreover whenever I trying to pass pp as the argument to my functions,
its not able to find pp. I am getting cud not parse knowledge error.
can anyone pz help me out.
--
View this message in context: http://drools.46999.n3.nabble.com/Function-calls-in-decision-table-tp3919...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Help
by Olfa h
HI,
My master thesis is to develop a model interface that allows the
doctor to pose
the question for the patient. it consists of an interface and a database
format connaissace ontology. this application must guide the doctor.
The purpose of the ontology is to implement the interface model that
contains a text box to enter the question and a text box to type the answer
and then clicking a button data are displayed which are imported for the
ontology weight the answer and then if the readings are not in good clicks
a button to display other data but not displayed the first time and if the
election is made on a data. By clicking a button to display the data that
are connected to select data and then validate the choice.
Please can you guide me to make this work?
can you give to me a detailed description and the simplest methods to
follow and i inform you about all the information concerned my
environment to lead a good results because i'm a beginner in this domain ?
If there is any point on the ontology create or something missing you
can tell me because this is the first that I work with ontologies.
so I just need to realized this little application to validate the model
interface and the ontology and I like that you guide me.
Attached is the interface model and the ontology.
I await your advise and your help.
Thank you very much.
13 years, 9 months
Inserting facts using declared types from XML
by Francois Rouaix
Folks,
I'm trying to use Drools in a mostly Java-less environment (rules are
written in .drl files, facts will be inserted from XML files). I'm running
into an issue where the XStream unmarshaller is unable to convert my XML to
a BatchExecutionCommand because it cannot find the class for a type
declared in the .drl file.
Is there any configuration required to make sure the XStream marshaller
knows about the dynamically generated classes from the .drl?
I'd appreciated any clues. I cannot add POJO classes for my types due to
the nature of the app.
Thanks.
DRL file
-----------
package com.example
declare Answers
....
end
/* some rules after this */
...
XML file
-----------
<batch-execution>
<insert>
<com.example.Answers>
....
Runner code
public static void Run(String xmlFactsFile, String drlFilename)
{
// Compile the drl file
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newFileResource(drlFilename),
ResourceType.DRL );
if ( kbuilder.hasErrors() ) {
System.err.println( kbuilder.getErrors().toString() );
throw new RuntimeException("Cannot compile \"" + drlFilename + "\"");
}
// kbase setup from the compiled rules
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
File facts = new File(xmlFactsFile);
BatchExecutionCommand command = (BatchExecutionCommand)
BatchExecutionHelper.newXStreamMarshaller().fromXML(facts);
ExecutionResults bresults = ksession.execute(command);
System.out.println(BatchExecutionHelper.newXStreamMarshaller().toXML(bresults));
}
}
Error at runtime
----------------------
Exception in thread "main"
com.thoughtworks.xstream.converters.ConversionException:
com.example.Answers : com.example.Answers
---- Debugging information ----
message : com.example.Answers
cause-exception :
com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : com.example.Answers
class : org.drools.command.runtime.rule.InsertObjectCommand
required-type : org.drools.command.runtime.rule.InsertObjectCommand
converter-type :
org.drools.runtime.help.impl.XStreamXML$InsertConverter
path : /batch-execution/insert/com.example.Answers
line number : 3
class[1] : org.drools.command.runtime.BatchExecutionCommandImpl
converter-type[1] :
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : null
-------------------------------
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
at
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:318)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:230)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at
com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:930)
at
com.intentsoft.RulesEngine.RulesExecution.Run(RulesExecution.java:34)
at com.intentsoft.RulesEngine.Main.main(Main.java:10)
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException:
com.example.Answers
at
com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:56)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at
com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:45)
at
com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
at
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:70)
at
org.drools.runtime.help.impl.XStreamXML$InsertConverter.unmarshal(XStreamXML.java:135)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
... 16 more
13 years, 9 months
Integrating Drools with rules from a legacy BRMS
by bdolbeare
I am working on integrating Drools with a legacy BRMS that was developed
in-house. The customers like the BRMS and are unwilling to migrate to
another tool such as Guvnor. The BRMS creates the rules in a proprietary
XML format. In order to integrate Drools with the BRMS, I need to convert
these rules to a format that Drools understands and that leaves me with what
seems like 3 options:
1) Write some XSLT to transform the proprietary XML to Drools XML format.
This seems straightforward; however, I am concerned that the online
documentation states that the Drools XML format should be considered
deprecated. I'd hate to invest much time in this approach if the XML support
is going to disappear in a future release.
2) Write my own parser that can convert the proprietary XML to classes in
the org.lang.descr package. I'm not sure if the Drools developers intend for
others to use these classes directly. For instance, if they change
frequently, this approach may be difficult to maintain.
3) Write my own parser that can convert the proprietary XML to DRL. This
approach seems unfortunate in that the rules would be parsed twice; first to
convert them to DRL and then internally by the Drools DrlParser. Also, this
doesn't seem to offer any benefit over approach 2 (except that I know DRL
well and wouldn't have to learn how the org.lang.descr classes work [not
much documentation in those classes]).
Right now, I'm leaning towards approach 2. Any thoughts or suggestions
would be appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/Integrating-Drools-with-rules-from-a-le...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Possibly race condition in a persisted Drools + JBPM during a StatefulKnowledgeSession
by Alberto R. Galdo
Hi all,
We've been for long time now developing a complex event processing
system that ( simplified version ahead !! ) involves a set of rules that in
turn activates a set processes that fulfill human tasks and other kind of
tasks.. This all is running in a StatefulKnowledgeSession with JPA
persistence configured both for Drools and JBPM. We are running an stack of
Drools, JBPM, Drools Integration, Drools fussion, etc..
We've been able to persist Drools sessions & JBPM processes in the same
Persistence Context ( not without pain :( ) using different JTA
implementations including ( but not limited to ) Bitronix & Atomikos.
What we are observing here is what seems to be some kind of race
condition between Drools and JBPM when running the knowledge session when
JPA&JTA persistence is configured. Very often, as soon as after 2-3
processes get created as rule's consequences are fired in response of
events inside the session we see how JBPM finds its instance nullified by
Drools when it tries to end a process and persist it.
We've been able to find where Drools decides to delete an instance of
the process ... at a given time Drools executes
JPAProcessInstanceManager.clearProcessInstances() [1] when it finalizes a
SingleSessionCommand wich in turn calls disconnect() for *all* the
local-stored processinstances ( wich gets populated with instances of
processes every time a process is started in the knowledge session ):
public void clearProcessInstances() {
for (ProcessInstance processInstance: new
ArrayList<ProcessInstance>(processInstances.values())) {
((ProcessInstanceImpl) processInstance).disconnect();
}
}
So, Drools decides to disconnect all process instances in it's JPA
context without taking in account the state the process is in, and when an
processinstance that is not stopped gets removed then JBPM finds it's
NullPointerException...
We've modified the code to make Drools aware of the state of the
process before wiping it from the context ( no problem here, there will
be no leak as a running processinstance will be removed in future calls of
"clearProcessInstances" given the process is closed ). But unfortunatelly
this seems to resolve this problem, but lots of other problems ( wich seems
also race conditions arise : for instance: Drools closes connections to
the database and JBPM finds the connection closed,
So, we are really worried about using Drools & JBPM in a persisted
environment. Maybe our asumptions are wrong... Is it possible to have an
scenario like ours given the current Drools & JBPM integration status for a
persistent statefulKnowledge Session? Did anyone build a complex event
processing system like ours in a unaltered persistence environment such as
provided in Drools and JBPM by default?
Greets,
[1]
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-persistence-jpa/src/m...
Alberto R. Galdo
argaldo(a)gmail.co <argaldo(a)gmail.com>
13 years, 9 months
Lots of org.drools.common.ScheduledAgendaItem instances in memory
by Werner Stoop
Hi,
We're using Drools with a StatefulKnowledgeSession to process events coming
from equipment in our network. The system draws conclusions about the state
of the equipment and writes those conclusions to a table in our
database. All our rules work as we expected and the system produces the
correct results.
However, the memory usage of the JVM steadily goes up when the system runs
for extended periods of time until we start getting OutOfMemoryExceptions
and the server has to be restarted. This is in spite of the fact that the
fact count reported by
the StatefulKnowledgeSession.getFactCount() stays reasonably stable,
with around 30 000 facts (give or take) at any point in time.
I have run the Eclipse Memory Analyzer tool (http://www.eclipse.org/mat/)
against heap dumps from the JVM several times now, and every time it
reports more and more instances
of org.drools.common.ScheduledAgendaItem referenced from one instance of
java.lang.Object[]
To be concrete, since this morning the uptime is more than 112 hours in
total, during which the system has processed little over 2 000 000 events
from the network. It has 29 000 facts in the knowledge session, yet in the
heap dump we see 829 632 instances of org.drools.common.ScheduledAgendaItem.
What is the ScheduledAgendaItem for? Is there something wrong with my rules
that causes this many instances to be held? Is there something I should do
to release these instances or the Object[] holding on to them?
Thanks,
Werner Stoop
13 years, 9 months