Date equal comparison fails - don't understand why
by Saloojee, Karim
Hi
I am comparing SimpleAccount( dateAccountOpened == "5-Feb-2011")
where dateAccountOpened is "Sat Feb 05 00:00:00 GMT+02:00 2011" (if you
call toString()). The equal comparator fails (==) but the greater than
comparator passes (>) which I don't understand.
I feel I am missing something obvious here, but I have no idea what it
is.
rule "Test date equality"
when
$acc : SimpleAccount( dateAccountOpened == "5-Feb-2011")
then
System.out.println("Expected and found an account opened
on 5-Feb-2011: " + $acc);
end
rule "Some dates are more equal than others"
when
$acc : SimpleAccount( dateAccountOpened > "5-Feb-2011")
then
System.out.println("Unexpected match: " +
$acc.getDateAccountOpened());
end
Regards,
Karim
To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser:
https://www.fnb.co.za/disclaimer.html
If you are unable to access the Disclaimer, send a blank e-mail to
firstrandbankdisclaimer(a)fnb.co.za and we will send you a copy of the Disclaimer.
11 years
Transaction problems in high concurrency JBPM+Drools+Hibernate instalation
by Alberto R. Galdo
Hi guys,
We have an application built around long running JBPM processes with a
large user base and high concurrency ... early on we began to have issues
with transactions in JBPM and nowadays are watching lots of different
realizations of transaction managing problems that lead to dead human tasks
( state: ERROR ), errors running processes and so on ( different
exceptions follows ):
13:22:48,261 WARN [org.drools.persistence.jta.JtaTransactionManager]
(pool-11-thread-1) Unable to commit transaction:
javax.transaction.RollbackException: ARJUNA016053: Could not commit
transaction
Caused by: javax.persistence.PersistenceException: error during managed
flush
Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not
commit transaction.
at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
at
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at
org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167)
at
org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)
[drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
Caused by: javax.persistence.PersistenceException:
org.hibernate.HibernateException: Flush during cascade is dangerous
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361)
[hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289)
[hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
11:46:23,754 ERROR [stderr] (schedulerVT_Worker-8)
javax.persistence.PersistenceException: org.hibernate.HibernateException:
proxy handle is no longer valid
11:46:23,754 ERROR [stderr] (schedulerVT_Worker-8) at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361)
11:46:23,755 ERROR [stderr] (schedulerVT_Worker-8) at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289)
11:46:23,756 ERROR [stderr] (schedulerVT_Worker-8) at
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:261)
11:46:23,756 ERROR [stderr] (schedulerVT_Worker-8) at
So, we're running this installation by the manual. Are using JBoss 7 as
application server, it's transaction manager, Hibernate 4.x as entity
manager, our connection pool delivers READ_COMMITED connections ( so does
hibernate ) ...
Is there anything else we should be doing to avoid this transactional
problems? Has anyone ever tested JBPM in such concurrent scenario? Any
experiences?
Alberto R. Galdo
argaldo(a)gmail.com
11 years
Scaling Drools based application
by Arul Prashanth
We have an requirement to scale the implemented Drools Rule Engine to all
states in United States. With respect to the current implementation we have
around 50 decision tables which when packaged creates a 200 MB pkg file and
another pkg around 150 MB. The request which the drools engine consumes is a
150 KB xml file which is marshalled and processed. We have a JBoss server
configured with 4 GB of memory (heap size + permGen) and works well with
processing 5 concurrent request. Any request beyond 5 leads to
OutOfMemoryException
Now we have to scale this application to process request from 45 states, so
there will be state specific pkg files (350 MB of pkg file). Each pkg is
different for each state.
With all this, do we need to increase the memory as no of states * 4 GB. Is
this assumption correct? Is there a better architecture to handle scaling of
drools application.
Any memory/performance tuning tricks would also be helpful.
-----
- Prashanth
--
View this message in context: http://drools.46999.n3.nabble.com/Scaling-Drools-based-application-tp4026...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Weird classloader problem
by Alexander Herwix
Hey guys,
using Drools 6 RC4. I have a simple rule which should cast an object into a specialized object (if it is indeed a specialization) and insert that into the session.
rule "Obj is SpecialObject"
salience 201
when
$mainObj : MainObj(obj.class == SpecialObject.class, $obj : obj)
then
System.out.println("Obj is SpecialObj");
SpecialObj specialObj = (SpecialObj) $obj;
insert(specialObj);
end
This rule doesn't even compile and I get a nasty error: NoClassDefFoundError: com/iterranux/droolsjbpmHumanTask/domain/team__I (wrong name: com/iterranux/droolsjbpmHumanTask/domain/Team__I).
I mean it looks like the Class is present, but somehow it's lowercased somewhere. It's weird I can use some other obj but this doesn't work. Anyone seen something like this before? Maybe some other way to do what I want to do? I tried to declare a trait and don that obj with that but same result.
Another question would be if it is really necessary to insert the object as a new fact, or could I access the nested property directly in a rule and typecast it there somehow?
Cheers, Alex
Error java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
| Error at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:104)
| Error at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
| Error at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
| Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
| Error at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
| Error at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:648)
| Error at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:758)
| Error at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:746)
| Error at java.lang.Class.forName0(Native Method)
| Error at java.lang.Class.forName(Class.java:266)
| Error at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:80)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
| Error at java.lang.Class.forName0(Native Method)
| Error at java.lang.Class.forName(Class.java:266)
| Error at org.mvel2.ParserConfiguration.checkForDynamicImport(ParserConfiguration.java:163)
| Error at org.mvel2.ParserConfiguration.hasImport(ParserConfiguration.java:191)
| Error at org.mvel2.ParserContext.hasImport(ParserContext.java:360)
| Error at org.mvel2.compiler.AbstractParser.createPropertyToken(AbstractParser.java:1341)
| Error at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:846)
| Error at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:128)
| Error at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
| Error at org.mvel2.MVEL.analyze(MVEL.java:680)
| Error at org.mvel2.compiler.PropertyVerifier.getMethod(PropertyVerifier.java:536)
| Error at org.mvel2.compiler.PropertyVerifier.analyze(PropertyVerifier.java:120)
| Error at org.mvel2.compiler.ExpressionCompiler.verify(ExpressionCompiler.java:381)
| Error at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:273)
| Error at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
| Error at org.mvel2.MVEL.analyze(MVEL.java:680)
| Error at org.mvel2.MVEL.analyze(MVEL.java:685)
| Error at org.drools.compiler.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:114)
| Error at org.drools.compiler.rule.builder.dialect.mvel.MVELDialect.analyzeBlock(MVELDialect.java:539)
| Error at org.drools.compiler.rule.builder.dialect.mvel.MVELConsequenceBuilder.build(MVELConsequenceBuilder.java:130)
| Error at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:103)
| Error at org.drools.compiler.compiler.PackageBuilder.addRule(PackageBuilder.java:3160)
| Error at org.drools.compiler.compiler.PackageBuilder.compileRules(PackageBuilder.java:1047)
| Error at org.drools.compiler.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:952)
| Error at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildRules(CompositeKnowledgeBuilderImpl.java:231)
| Error at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:86)
| Error at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:75)
| Error at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:201)
| Error at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:39)
| Error at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:305)
| Error at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:187)
| Error at com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder.buildKmoduleForGrailsModule(KieModuleBuilder.java:127)
| Error at com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder.buildKmoduleForGrailsModule(KieModuleBuilder.java:148)
| Error at com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder$buildKmoduleForGrailsModule.call(Unknown Source)
| Error at DroolsjbpmCoreGrailsPlugin$_closure7.doCall(DroolsjbpmCoreGrailsPlugin.groovy:386)
| Error at sun.reflect.GeneratedMethodAccessor992.invoke(Unknown Source)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.OriginalClassInvoker.invoke(OriginalClassInvoker.java:47)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1283)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at groovy.lang.Closure.call(Closure.java:411)
| Error at DroolsjbpmCoreGrailsPlugin$_closure7.call(DroolsjbpmCoreGrailsPlugin.groovy)
| Error at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.invokeOnChangeListener(DefaultGrailsPlugin.java:767)
| Error at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:716)
| Error at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:731)
| Error at org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.informOfClassChange(AbstractGrailsPluginManager.java:406)
| Error at org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.informOfFileChange(AbstractGrailsPluginManager.java:367)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.informPluginManager(GrailsProjectWatcher.java:243)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.access$400(GrailsProjectWatcher.java:46)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher$1.onChange(GrailsProjectWatcher.java:154)
| Error at org.codehaus.groovy.grails.compiler.DirectoryWatcher.fireOnChange(DirectoryWatcher.java:174)
| Error at org.codehaus.groovy.grails.compiler.DirectoryWatcher.run(DirectoryWatcher.java:156)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.run(GrailsProjectWatcher.java:178)
| Error at java_lang_Runnable$run.call(Unknown Source)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.startProjectWatcher(ForkedGrailsProcess.groovy:702)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure16.doCall(ForkedGrailsProcess.groovy:691)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure16.doCall(ForkedGrailsProcess.groovy)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at groovy.lang.Closure.call(Closure.java:411)
| Error at groovy.lang.Closure.call(Closure.java:405)
| Error at groovy.lang.Closure.run(Closure.java:492)
| Error at java.lang.Thread.run(Thread.java:722)
| Error Caused by: org.springsource.loaded.ReloadException: Problem defining class com.iterranux.droolsjbpmHumanTask.domain.team__I
| Error at org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1076)
| Error at org.springsource.loaded.ReloadableType.rewriteCallSitesAndDefine(ReloadableType.java:807)
| Error at org.springsource.loaded.ReloadableType.<init>(ReloadableType.java:151)
| Error at org.springsource.loaded.TypeRegistry.addType(TypeRegistry.java:889)
| Error at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:246)
| Error at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
| Error ... 114 more
| Error Caused by: java.lang.reflect.InvocationTargetException
| Error at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1071)
| Error ... 119 more
| Error Caused by: java.lang.NoClassDefFoundError: com/iterranux/droolsjbpmHumanTask/domain/team__I (wrong name: com/iterranux/droolsjbpmHumanTask/domain/Team__I)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
| Error ... 123 more
11 years
Drools Perm gen grows constantly
by pmander
Fairly new to drools here but we are using it on a standalone application to
do some batch processing. The application is spring based and
single-threaded. I am using a single stateful session that I build around
15,000 rules dynamically on process startup.
The application then receives a message to process a set of records through
the rules and write out the results. To do this I insert the data as facts
and run a query to get the results. I must then remove all the facts that I
created and also all the object that where created by the rules so that the
session can be used for the next batch of records.
This works fine and meets our performance requirements. However, after a
time the process fails and upon investigation this is due to the perm gen
space filling up with classes. The heap itself is fine and steady by the
number of classes in the JVM keeps growing. These classes are all
DefaultConsequenceInvokerGenerated classes appear to be created when my new
facts are inserted.
This is running on a 1.7 oracle JVM and I've tried -XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled but nothing helps.
So is this expected behaviour? Is there an issue with how I am using drools?
Any help much appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Perm-gen-grows-constantly-tp4026...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Info on Drools 6 documentation
by Gianvicenzo CAPUTO
Hello,
It seems to me that the documentation of Drools Guvnor 6.0.0 RC5 does
not correspond to the web interface I see.
Is that me or there is indeed a discrepancy? In the latter case anyone
knows when the updated doc will be available? the final release
probably?
Thanks for your help.
V.
11 years
Usage of Drools Configuration Attributes
by Arul Prashanth
Anyone know what these options are for and does this configuration help in
reducing the rule execution time and memory usage. I couldn't find much
details on these option apart from few like maintainTMS and shareAlphaNodes.
drools.maintainTms
drools.assertBehaviour
drools.logicalOverride
drools.sequential
drools.sequential.agenda
drools.removeIdentities
drools.shareAlphaNodes
drools.shareBetaNodes
drools.alphaNodeHashingThreshold
drools.compositeKeyDepth
drools.indexLeftBetaMemory
drools.indexRightBetaMemory
drools.consequenceExceptionHandler
drools.mbeans
Are there any optimal values to improve performance.
-----
- Prashanth
--
View this message in context: http://drools.46999.n3.nabble.com/Usage-of-Drools-Configuration-Attribute...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Equal shift assignment based on employment form
by ns
Hi,
I would like to distribute shifts equally among employees based on their
employment form (full time or part time: 100%, 75%, 50%, ...). I have a
variable for each employee that holds the employment form. How do I make
sure all shifts get distributed equally, so that somebody that works 50% of
the time only gets half the shifts assigned than someone who works 100%.
And how do I make sure shifts that employee need to do are distributed
equally over time. So for example we have 20 shifts a month and 5 employees.
How do I make sure I get a plan like e1, e2, e3, e4, e5, e1, e2, e3, e4, e5,
... Instead of e1, e1, e1, e1, e1, e2, e2, e2, e2, e2. Thanks.
Kind regards,
Nick
--
View this message in context: http://drools.46999.n3.nabble.com/Equal-shift-assignment-based-on-employm...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years