understanding Rete enhancements of Drools
by raffi
Hi community,
I have two questions abot the improvements of the Rete algorithm. First one
is about the HashMap which is filled if there is a new AlphaNodeadded to a
ObjectTypeNode. In which java class is this data structure?
Second question is a little bit of generic type. I read the documentation of
5.4.0 about the enhancement of indexing the BetaNodes (JoinNodes). But for
me its not that clear how this works. Is there another HashMap with for
example a key value /cheddar/ if I have a join between a /person/- and
/cheese/-fact type like in the examples? Or does it only check the field of
the join (String, Integer and so on)?
Andf if an object comes from the right side it could move into the Tuple of
the left side if this check was valid?
Thank you for reply.
--
View this message in context: http://drools.46999.n3.nabble.com/understanding-Rete-enhancements-of-Droo...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Test Scenario not firing rule when a ruleflow-group is defined
by mpgong
Hello,
I created a simple rule using the guvnor drl editor - it looks like this:
rule "Rule1"
no-loop true
ruleflow-group "CheckOne"
when
$ca : TestFact()
then
System.out.println("Hello World");
end
when i create the scenario, where i insert a TestFact() object and added the
expected rule to fire 'Rule1' and then hit the run scenario, the output said
Rule1 was not activated and no rule fired. However, when i take the rule
flow group out it fires.
Any idea why this might be. Now i am able to use ruleflow-groups in my
application but those rules where built with the decision tables (xls) and
uploaded to guvnor.
The new set of rules are small and simple so i was just going to create them
using drl. This seems to be causing me problems because i'm trying to run
these rules from a process and they aren't firing in there either.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Test-Scenario-not-firing-rule-when-a-ru...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Best practice to use heap memory effectively
by mohan
Hi ,
I want to keep events valid for 24 hour period. Per day I’m getting over
1000K events & insert into session. I saw that heap usage increase
drastically because of this. What is the best practice to handle such a
situation? Do I need to choose some caching mechanism?
Meantime I’m using “Statefulknowledge” session and use single session to
cater each event & never call session.dispose(). Will there be any impact?
I’m using Drool 5.1.1, jboss-5.1.0.GA, jre 1.6.0_33
Thanks.
Mohan
--
View this message in context: http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effect...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Is Flow / jBPM dying on the vine?
by dunnlow
Hi,
I am considering using drools with Flow/jBPM as an integral part of a
corporate solution. However, it seems to me like the project is dying on
the vine. I understand the code is still being worked but overall interest
seems to be waning; evidenced by things like, a (...the) jBPM 5 book due two
months ago is still MIA. No blog posts on the project for six weeks.
I don't mean to bash jBPM, but am just worried about it's future. I suppose
the Flow/jBPM merge is irreversible? Any thoughts?
Is anyone using another BPM system with drools?
Thanks,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Is-Flow-jBPM-dying-on-the-vine-tp402073...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Re: [rules-users] JITting error with 5.5.0.CR1
by paulk_asert
I should have added that the script still completes successfully, it is only
the JIT optimization that is having problems and only when some threshold is
reached causing an attempt at performing the optimization - as per
descriptions I have read earlier. The problem is that I thought there was a
fix already in place for this problem if I read the earlier posts correctly
but perhaps I do not know how to enable it.
paulk_asert wrote
> When I run this Groovy script using drools 5.5.0.CR1 with numAnimals = 8
> and numLegs = 120, it works fine. If I set numAnimals = 17 and numLegs =
> 1020 then it fails with a JITting error. I saw a bunch of Jira issues
> related to JITting issues but no open ones seemed to match exactly.
>
> @GrabResolver('https://repository.jboss.org/nexus/content/groups/public-jboss/')
> @Grab('org.drools:knowledge-api:5.5.0.CR1')
> @Grab('org.drools:drools-compiler:5.5.0.CR1')
> @Grab('org.drools:drools-core:5.5.0.CR1')
> @Grab('com.sun.xml.bind:jaxb-xjc:2.2.5.jboss-1')
> @GrabExclude('com.github.relaxng:relaxngDatatype')
> @GrabResolver('http://repo2.maven.org/maven2/')
> @Grab('org.mvel#mvel2;2.1.2.Final')
> @Grab('org.slf4j#slf4j-simple;1.6.4')
> import groovy.transform.Immutable
> import static org.drools.KnowledgeBaseFactory.newKnowledgeBase
> import static
> org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder
> import static org.drools.builder.ResourceType.DRL
> import static org.drools.io.ResourceFactory.newReaderResource
>
> def numAnimals = 8
> def numLegs = 120
> def kbuilder = newKnowledgeBuilder()
> def drl = '''
> dialect "mvel"
> rule "deduce animal counts"
> when
> $crane : Crane( )
> $centipede : Centipede( )
> $tortoise : Tortoise(
> quantity + $crane.quantity + $centipede.quantity == ''' + numAnimals
> + ''',
> quantity * numLegs + $crane.quantity * $crane.numLegs +
> $centipede.quantity * $centipede.numLegs == ''' + numLegs + '''
> )
> then
> System.out.println( "Cranes " + $crane.getQuantity() )
> System.out.println( "Tortoises " + $tortoise.getQuantity() )
> System.out.println( "Centipedes " + $centipede.getQuantity() )
> end
> '''
> kbuilder.add(newReaderResource(new StringReader(drl)), DRL)
> def kbase = newKnowledgeBase()
> kbase.addKnowledgePackages(kbuilder.knowledgePackages)
> def ksession = kbase.newStatefulKnowledgeSession()
>
> (numAnimals + 1).times { n ->
> if (numLegs.intdiv(Crane.numLegs) >= n) {
> ksession.insert(new Crane(n))
> }
> if (numLegs.intdiv(Tortoise.numLegs) >= n) {
> ksession.insert(new Tortoise(n))
> }
> if (numLegs.intdiv(Centipede.numLegs) >= n) {
> ksession.insert(new Centipede(n))
> }
> }
>
> ksession.fireAllRules()
> ksession.dispose()
>
> @Immutable
> class Crane {
> static int numLegs = 2
> int quantity
> }
>
> @Immutable
> class Tortoise {
> static int numLegs = 4
> int quantity
> }
>
> @Immutable
> class Centipede {
> static int numLegs = 100
> int quantity
> }
>
> Here is the error message:
>
> Exception in thread "Thread-1" java.lang.RuntimeException: Exception
> jitting: quantity + $crane.quantity + $centipede.quantity == 17 &&
> quantity * numLegs + $crane.quantity * $crane.numLegs +
> $centipede.quantity * $centipede.numLegs == 1020
> at
> org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:275)
> at
> org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
> at
> org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error
> writing method evaluate
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:200)
> at
> org.drools.rule.constraint.ASMConditionEvaluatorJitter.jitEvaluator(ASMConditionEvaluatorJitter.java:53)
> at
> org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:273)
> ... 5 more
> Caused by: java.lang.RuntimeException: Error writing method evaluate
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:881)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:128)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.generateClass(ClassGenerator.java:144)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:198)
> ... 7 more
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
> at org.mvel2.asm.Frame.merge(Frame.java:1373)
> at org.mvel2.asm.Frame.merge(Frame.java:1329)
> at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:879)
> ... 10 more
>
> Is this a known issue?
>
> Thanks, Paul.
--
View this message in context: http://drools.46999.n3.nabble.com/JITting-error-with-5-5-0-CR1-tp4020565p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Decision table errors
by Mahadevappa, Shobha
Hi,
I have a decision table which has an invalid column.
Drools gives the below compilation error but I am not sure about what is the line number (highlighted in red below) it is referring to in the error message.
Any pointers towards this is greatly appreciated.
Unable to Analyse Expression logType_41 == "2101":
Error: unable to resolve method using strict-mode: com.keane.nREAP.util.generatedclasses.SHOLOG.logType_41()]
Near : {... logType_41 == "2101" ....}]
^
[Line: 8, Column: 19] : [Rule name='VerificationAgain_12']
Regards,
Shobha M | Senior Program Manager, A&AD | NTT DATA Global Delivery Services Limited| w. +91-80-26659482 (Ext 3679) | v. 8814.3679 | m. +91.9972522743 | shobha.mahadevappa(a)nttdata.com<mailto:shobha.mahadevappa@nttdata.com>
______________________________________________________________________
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding
13 years, 4 months
Locking problems when using JBPM with persistence on PostgreSQL
by Alberto R. Galdo
Hi,
We have a system that executes processes inside a JBPM session which is
persisted using JPA and Hibernate as entity manager .
What we are suffering is locking inside JBPM in certain circumstances.
What we experience is that the JBPM process gets locked when in a
transaction to store it's internal state in the database ( sessioninfo,
processinstanceinfo, ... ). When locked PostgreSQL has a connection that is
in state "idle in transation", this means that a transaction was open (
BEGIN ) and nobody did neither commit nor rollback. Both JBPM and
PostgreSQL are waiting for something to happend that never comes. And there
are ExclusiveLocks and RowExclusiveLocks available in the database (
different tables each time, sometimes pg_largeobject, sometimes others ).
Our application that uses extensively JBPM is then locked and our users
are unable to execute any operation. We even tried to solve the lock by
killing the connection to the database, then the locks in the database
dissappear but JBPM never recovers ( maybe died with the connection ).
Has anyone seen something like this before?
Greets,
Alberto R. Galdo
argaldo(a)gmail.com
13 years, 4 months