ArrayIndexOutOfBounds when calling addKnowledgePackage?
by malkhafaji
Hello,
I am trying to create a bunch of KnowledgeBase objects, this is what I am
doing:
1. create one List of KnowledgePackage objects (pre-compile them).
2. Create X number of KnowledgeBases, and for each knowledge base do this:
for (KnowledgePackage kp : this.knowledgePackages) {
Collection<KnowledgePackage> collections = new
ArrayList<KnowledgePackage>();
collections.add(kp);
knowledgeBase.addKnowledgePackages(collections);
}
Please forget about optimizations for now, this is just an isolated test to
solve this issue. So, notice how I am using the SAME list of
KnowledgePackage objects, but to initialize MULTIPLE KnowledgeBase
instances. Here is the exception that I am getting (and sometimes I get it
sometimes I don't on the same code!). This exception happens exactly at the
addKnowledgePackage line (last line in the loop above). One last piece of
information, I am executing the code above in a thread, meaning multiple
threads are accessing the same KnowledgePackage array list but populating
totally distinct KnowledgeBases. Any idea any one?
Exception in thread "KnowledgeBasePoolObject_Init_1"
java.lang.ArrayIndexOutOfBo
undsException: 7
at java.util.ArrayList.add(Unknown Source)
at org.drools.rule.EvalCondition.clone(EvalCondition.java:135)
at
org.drools.rule.LogicTransformer$AndOrTransformation.transform(LogicT
ransformer.java:330)
at
org.drools.rule.LogicTransformer.applyOrTransformation(LogicTransform
er.java:242)
at
org.drools.rule.LogicTransformer.processTree(LogicTransformer.java:23
2)
at
org.drools.rule.LogicTransformer.transform(LogicTransformer.java:81)
at org.drools.rule.Rule.getTransformedLhs(Rule.java:523)
at
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder
.java:97)
at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:117)
at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:409)
at
org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:635)
at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:
517)
at
org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:426)
at
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseI
mpl.java:121)
at
com.medcpu.mpu.pp.engine.KnowledgeBasePool.getNewKnowledgeBasePoolObj
ect(KnowledgeBasePool.java:125)
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/ArrayIndexOutOfBounds...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
Re: [rules-users] Matching on instanceof without eval?
by Giovanni Motta
I suppose this should work, also:
when
position : Position()
option: OptionInstrument() from position.instrument
And to me it looks well readable. But what difference does it make, behind
the curtains? Is it more or less efficient?
13 years, 11 months
How to use arrays in rules
by shekharputtur puttur
Hi All,
I have a requirement, where I need to access individual array element and
update in the 'THEN' part of a rule definition in Guvnor.
For eg:
WHEN
THEN
GlobalData[inputID].deduct = 'integer data'
How to do these kind of tasks on arrays in guvnor
Could you please tell me
Thanks & Regards
Shekhar
13 years, 11 months
Call for Vote: Drools support in IntelliJ IDEA
by Ansgar Konermann
Hi everyone,
I'm wondering whether there are any Drools users on this list using
IntelliJ IDEA to do their regular development work.
As you might know, there is currently no Drools support in IntelliJ
IDEA. However, it would be nice to have this support. Switching between
your Java / Groovy / Scala / whatever project in IDEA and your rules
project in a different tool is cumbersome. There must be one tool to
rule them all! :-)
There exists a feature request to add Drools support to one of the
future releases of IntelliJ IDEA.
Sadly, the feature request seems to have received only little attention
from the IDEA developers.
If you want to help out changing this, register a user account with the
IntelliJ issue tracking system [1] and vote for this feature request
[2]. Also feel free to add your comments or needs to the issue ticket.
I'd be glad if some of you vote for this ticket. Thanks.
Regards
Ansgar
[1] http://youtrack.jetbrains.net/registerUserForm
[2] http://youtrack.jetbrains.net/issue/IDEA-24348
13 years, 11 months
Drools flow VS jBPM4
by HONG DENG
Has anyone seriously compared the functional difference between the
two flow engine? Which one is more flexible and expansible?
13 years, 11 months
latest build failing????
by KiranP
i was using the snapshot version for drools in a drools-spring
web-application with spring 3.0
till yesterday everything was fine but today when started maven updated some
jars and my test cases started failing the stack trace is given below
does latest update creating some problems............
i have excluded the spring 2.5.5 dependency from drools-spring so as already
spring 3.0 jars are there
java.lang.NoSuchMethodError:
org.drools.reteoo.ReteooWorkingMemory.setEndOperationListener(Lorg/drools/common/AbstractWorkingMemory$EndOperationListener;)V
at
org.drools.container.spring.beans.persistence.SpringSingleSessionCommandService$1$1.doInJpa(SpringSingleSessionCommandService.java:101)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
at
org.drools.container.spring.beans.persistence.SpringSingleSessionCommandService$1.doInTransaction(SpringSingleSessionCommandService.java:94)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at
org.drools.container.spring.beans.persistence.SpringSingleSessionCommandService.<init>(SpringSingleSessionCommandService.java:92)
at
org.drools.container.spring.beans.JPASingleSessionCommandServiceFactory$JPASessionService.newStatefulKnowledgeSession(JPASingleSessionCommandServiceFactory.java:131)
at
org.mkcl.insync.services.impl.ProcessServiceImpl.startProcess(ProcessServiceImpl.java:65)
at
org.mkcl.insync.service.test.ProcessServiceTest.testFlowStart(ProcessServiceTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
-----
Keep Working >>
KiranP
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/latest-build-failing-...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
from accumulate($somevar)?
by ljnelson
I have a rule that needs to make use of the accumulate() function.
It also needs the value of the first argument to the accumulate() function.
Suppose there are 5 Xs in working memory, each with "count" fields.
I need--in my consequence--access to (a) the list of 5 Xs, and (b) the
result of the accumulate function having worked on them (in my case it's
really just a simple sum, so accumulate(X($count : count), sum($count))).
Naively, I tried this, having a strong and accurate supposition that it
wasn't going to work:
when
$xs : ArrayList() from collect(X())
$total : Number() from accumulate($xs, sum(count))
At any rate, I hope that helps convey what I need. My consequence needs the
list of Xs the accumulate function worked on, as well as the result of the
accumulate function (the Number). What's the best way to accomplish this?
Thanks in advance,
Laird
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/from-accumulate-somev...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
Drools Road Map ????????????
by KiranP
hello ,
our team has decided to use drools-flow and guvnor for a process critical
application
we have been evaluating drools for 6-7 mnths till now but we still didnt get
any news on M2 release
can anybody point me to drools RoadMAp???????
answers like ...nearly finished and .....will be there in sometime are at
all not required
plz give some concrete dates....
if it exist???
-----
Keep Working >>
KiranP
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Road-Map-tp833...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
using property files in knowlegde base
by Kilian Reisenegger
Hi all!
First of all I have to say that I'm quite new to Drools, so please be
patient with me =)
My question regards the property files which can be assigned to a
package in the knowledge base. I'd like to store property files for
internationalization in the knowledge base and work with them in my
process definition. So far I added the needed files via the guvnor to my
package but how I'm supposed to load them in the process definition? I
already had a look at the documentations and api-javadoc but couldn't
find anything to answer my question.
Thanks in advance for your help.
Kilian
13 years, 11 months