drools expert: memory issues
by Miguel Machado
hi all,
I'm quite new to the drools rule engine and i've been using it for a project where i need to filter events and execute actions accordingly.
I'm currently running a DRL file and creating a stateful session from it, and then running 2/3 facts every time. Every X seconds I collect the available facts and call fireAllRules() + dispose(), always within the same session. The DRL file has circa 2160 rules declared (an external program is producing them), and i'm using the "no-loop", "lock-on-active", "activation-group" and "agenda-group" options on almost every one.
My main problem is that the software is consuming too much memory when it loads the rules to the knowledge base variable, it reaches +300Mb which is just not affordable in this project. Is there any way i can work around this? I've tried setting some configuration properties but to no avail. What techniques may i try in order to reduce memory load on drools startup? What would be the best approach for dealing with so many rules?
Anything would help, thanks in advance,
_ miguel
15 years, 11 months
Strange ArrayIndexOutOfBoundsException with decision tables
by murphy
Hello,
some days ago I implemented rules with a dicision table (5.0.1) and
everything works fine.
But suddenly I ran into a strange ArrayIndexOutOfBoundsException. I thought
my
decision table is the problem and so I tried to test with some simple tables
but I still
get the same error.
Here is the stacktrace:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at jxl.biff.StringHelper.getUnicodeString(StringHelper.java:155)
at jxl.biff.FormatRecord.<init>(FormatRecord.java:158)
at jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:538)
at jxl.Workbook.getWorkbook(Workbook.java:253)
at jxl.Workbook.getWorkbook(Workbook.java:235)
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:74)
at
org.drools.decisiontable.SpreadsheetCompiler.getRuleSheetListener(SpreadsheetCompiler.java:148)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:131)
at
org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:32)
at
org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:19)
at
org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:16)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:508)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:31)
This is the code the files get loaded with:
KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
DecisionTableConfiguration dtconf =
KnowledgeBuilderFactory.newDecisionTableConfiguration();
dtconf.setInputType( DecisionTableInputType.XLS );
dtconf.setWorksheetName("Tables");
kBuilder.add(ResourceFactory.newClassPathResource(source),
ResourceType.DTABLE, dtconf);
This is the simple Test.xls, just with a package- and ruletable-declaration:
http://n3.nabble.com/forum/FileDownload.jtp?type=n&id=756101&name=Test.xls
Test.xls
Regards,
Christian
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Strange-ArrayIndexOut...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Error when uploading a rule flow into Guvnor
by ramram
Hi all,
I have the following problem:
1- I am uploading a rule file into the guvnor the file can be uploaded
successfully
2- When I go to the default package and I press save and validate there is
no error and all is fine till here
3- When I build the package I am having the following exception:
Rule Compilation Error the decleraed package "" doesnt match the
expected
and unable to generate rule invoker
After tracing it I find that it is resulting from the following:
I have in my Rule Flow that is being uploaded a split in the split there is
the following
<split id="5" name="Gateway" x="329" y="160" width="49" height="49"
type="2" >
<constraints>
<constraint toNodeId="13" name="End Process" priority="2"
type="code" dialect="java" >return endProcess;</constraint>
<constraint toNodeId="3" name="Create User" priority="1" type="code"
dialect="java" >return createUser;</constraint>
</constraints>
</split>
If I removed the type="code" from the constraint tag the process could be
uploaded successfully.
Can anyone help in this issue. plz
Regards,
ram
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Error-when-uploading-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Error deploy Guvnor - DEPLOYMENTS MISSING DEPENDENCIES
by andre.fonseca@mail.com
Hi all,
I am trying to deployed Guvnor (5.0 and 5.1) in Jboss 6.0 using Windows 7
I edited WEB-INF/components.xml to change the directory to uncoment the properties
<property name="homeDirectory">C:/my-path</property>
<property name="configurator">org.drools.repository.JackrabbitRepositoryConfigurator</property>
Then I created a folder in default/deploy in Jboss and copy all the content to there.
I am getting the exception below
Could someone please assist? There are something else I need to do except to edit components.xml?
I have also tested the deploy with the war file without sucess.
TIA
2010-04-23 10:17:44,761 INFO [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (Thread-2) Loading profile: ProfileKey@2c842c[domain=default, server=default, name=default]
2010-04-23 10:17:44,777 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (Thread-2) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "JBossTimerServiceFactory" is missing the following dependencies:
Dependency "jboss.ejb:service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.ejb:persistencePolicy=database,service=EJBTimerService" is missing the following dependencies:
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
Dependency "jboss.jdbc:datasource=DefaultDS,service=metadata" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **")
Deployment "jboss.ejb:service=EJBTimerService" is missing the following dependencies:
Dependency "jboss.ejb:persistencePolicy=database,service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory" is missing the following dependencies:
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging.connectionfactory:service=ClusteredConnectionFactory" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.messaging.connectionfactory:service=ClusteredConnectionFactory" is missing the following dependencies:
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.messaging.connectionfactory:service=ConnectionFactory" is missing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.messaging.destination:name=DLQ,service=Queue" is missing the following dependencies:
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.messaging.destination:name=ExpiryQueue,service=Queue" is missing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.messaging:service=JMSUserManager" is missing the following dependencies:
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
Deployment "jboss.messaging:service=PersistenceManager" is missing the following dependencies:
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
Deployment "jboss.messaging:service=PostOffice" is missing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
Deployment "jboss.messaging:service=ServerPeer" is missing the following dependencies:
Dependency "jboss.messaging:service=JMSUserManager" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss.messaging:service=PersistenceManager" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.mq:service=DestinationManager" is missing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss:service=KeyGeneratorFactory,type=HiLo" is missing the following dependencies:
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
DEPLOYMENTS IN ERROR:
Deployment "vfsfile:/C:/jboss/server/default/deploy/messaging/jms-ds.xml" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/transaction/xa/XAResource"
Deployment "jboss.jdbc:datasource=DefaultDS,service=metadata" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **
Deployment "jboss.web.deployment:war=/invoker" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss/server/default/deploy/http-invoker.sar/invoker.war/ deployment failed
Deployment "jboss.jca:name=DefaultDS,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **
Deployment "vfsfile:/C:/jboss/server/default/deploy/ROOT.war/" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss/server/default/deploy/ROOT.war/ deployment failed
Deployment "vfsfile:/C:/jboss/server/default/deploy/guvnor.war/" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/el/ELContext"
Deployment "vfsfile:/C:/jboss/server/default/deploy/hsqldb-ds.xml" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/transaction/xa/XAResource"
Deployment "vfsfile:/C:/jboss/server/default/deploy/jboss-war.war/" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss/server/default/deploy/jboss-war.war/ deployment failed
2010-04-23 10:17:44,808 INFO [org.apache.coyote.http11.Http11Protocol] (Thread-2) Starting Coyote HTTP/1.1 on http-127.0.0.1-8090
2010-04-23 10:17:44,823 INFO [org.apache.coyote.ajp.AjpProtocol] (Thread-2) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
2010-04-23 10:17:44,823 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] (Thread-2) JBossAS [6.0.0.20100216-M2 (build: SVNTag=JBoss_6_0_0_20100216-M2 date=20100216)] Started in 2m:4s:760ms
15 years, 11 months
How to access process variables within a work-item (human task)
by Robert
Hi,
I have
...
StatefulKnowledgeSession
ksession.getWorkItemManager().registerWorkItemHandler("Human Task",
taskHandler);
...
Map<String, Object> processVariables = new HashMap<String, Object>();
processVariables.put("equipment", "OvenQP33");
ProcessInstance pi = ksession.startProcess(processName,
processVariables);
...
... within the taskHandler.executeWorkItem(WorkItem workItem,
WorkItemManager workItemManager):
I am setting a break-point, and I am getting there, but how am I able to
access my processVariables or even set specific data for this particular
work-item ?
I tried using as described in the doc "9.1 Human tasks inside processes":
- Parameter mapping: Allows copying the value of process variables to
parameters of the human task. Upon creation of the human tasks, the
values will be copied.
But without any success. I just not getting to the "equipment" variable,
which I need at this point of processing the work-item.
The mapping I did: "equipment" -> "equipment". With the hope to find them
within workItem.getParameters(), but they are not there and nowhere-else
too.
Any ideas ?
Generally there are even many more settings possible for the human task,
see doc (here the list:
Id,Name,TaskName,Priority,Comment,ActorId,Skippable,Content,Swimlane,On-entry
and on-exit actions,Parameter mapping,Result mapping,Timers,ParentId), but
only a few are accessible through workItem.getParameters(). The others ?
Also, no idea to get this data.
Cheers, Rob.
--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/
15 years, 11 months
Multiple timers in a single ruleflow
by nanic23
Hi guys,
I am trying to implement multiple timers in a single ruleflow.
I am trying to achieve:
1. Multiple timers running at the same time.
2. Multiple timers running consecutively.
It seems to me that the current implementation will not allow for this kind
of behavior out of the box.
ksession.fireAllRules() and ksession.halt() are very wide spread (as they
act on the session and apply to “AllRules”) and don’t leave room to indicate
what timer you want to start and which one to stop.
This might work OK if you have only one timer, but if you have more than
one:
ksession.halt(); will stop all timers. And this is no good if you want to
stop only a “specific” one and have others keep running.
ksession.fireAllRules() will start all timers including timers you already
stopped.
E.g. a flow with 2 timers, you want to run first timer to send an email
periodically while your flow is suspended on Human Task. Once the flow is
resumed you’ll want run a second timer, down further on the flow, which
waits in a second Human Task node.
This works OK to the point where you do kesession.fireAllRules() to start
the second timer and get the first timer running again as a bonus :)
Has anybody implemented multiple timers? Any idea how to approach this?
I appreciate any comments,
Thanks,
Nick.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Multiple-timers-in-a-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Multithreading work items
by Pedro Maria Buitrago Mantilla
In general, I meet that for resolve the topic of multithreading it's
required to implement another thread over a work item.
How does the asynchronic task can modified a variable of Knowledgebase?
Can you give me an example?
Pedro Buitrago
15 years, 11 months
Can I use not and from in same condition?
by Ryan Fitzgerald
Hi,
I get an error with the following rule that appears only when I use the not keyword. If I remove the not keyword, it seems ok:
rule "WCDMA->GSM Bidirectional Relations Evaluation Rule - Version 4"
salience 10
dialect "java"
when
$extgsmcell : ExternalGsmCell()
$utrancell : UtranCell() from $extgsmcell.getIncomingUtranCells($extgsmcell.fdn)
$extutrancell : ExternalUtranCell ( rncid==$utrancell.rncid, cellid==$utrancell.cellid )
not GsmCell( lac==$extgsmcell.lac, cellid==$extgsmcell.cellid) from $extutrancell.getIncomingGsmCells($extutrancell.fdn)
then
System.out.println("Version 3: Missing Cell Relation from " + $utrancell.getFdn() + " to " + $extgsmcell.getFdn());
End
Any suggestions?
Thanks,
Ryan.
15 years, 11 months
How to access loggued username in a class
by fmetral
Hi all,
I face a very blocking problem and I require help to solve it quickly.
Is it possible to access the loggued username in a class. I mean, I have
created a class that connect to an other application (EAR) to get values
from enumerations.
But in this class, the retrieve the data, I need to have to the username of
the loggued user.
I have disabled the BRMS JAAS connector to delegate the authentication to my
application server.
Is their any class or mechanism to get the username of the loggued user?
Thanks in advance
Florent
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-access-loggued...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months