Drool 5 API and Agenda Listeners
by SPAAARKY21
I recently moved from Drool 4 to 5 in a little example application I had
written. At first I hesitated because I thought the API had changed
drastically. When I did upgrade, I found that there were few changes.
However, I was still using all of the "Rule" classes instead of the
"Knowledge" classes - like RuleBase and StatefulRuleSession instead of
KnowledgeBase and StatefulKnowledgeBase. It sounds like the "Knowledge" API
is the way of the future so to speak but I haven't been able to find much
information on it. What is the advantage in using the new "Knowledge" API?
Will the "Rule" API become deprecated at some point?
Anyway, after switching to the Knowledge API, I have been working on an
agenda listener I had written. What I want to do is iterate through agenda
groups on the focus stack and, for each group, iterate through the
activations in the order in which they are queued up. However, I don't see
any way to do that. In fact, since switching to Drools 5 and the
"Knowledge" API, it looks like the API for dealing with the agenda and
activations and whatnot has become quite small. Or at least it is when you
stick to the interfaces. Am I missing a better way of doing this?
Brandon
--
View this message in context: http://www.nabble.com/Drool-5-API-and-Agenda-Listeners-tp25844904p2584490...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 6 months
Implementaion of Rule Flow in Guvnor
by Ambika Goel
I am using the following code to add to knowledge builder and run it:
knowledgeBuilder.add(ResourceFactory.newClassPathResource("QueueFlow.rf", GuvnorTest.class), ResourceType.DRF) // ruleflow
knowledgeBuilder.add(ResourceFactory.newUrlResource("http://..."), ResourceType.PKG) // guvnor package
My rule flow is connection of two tables. I set a property in action of one decision table and use it as a condition in another decision table to get the desired result.
If I run the above code, I don't get any exception but the output is 'null'.
16 years, 6 months
Re: [rules-users] Drools Flow Persistence Doubt
by Pardeep.Ruhil@lntinfotech.com
Hi Mauricio,
Sorry for late replying, actually office is Off on Saturday's and Sundays.
Full stack trace is :
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.4.0.GA
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.3.1.GA
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.Environment
buildBytecodeProvider
INFO: Bytecode provider name : javassist
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Oct 12, 2009 9:32:56 AM org.hibernate.annotations.common.Version <clinit>
INFO: Hibernate Commons Annotations 3.1.0.GA
Oct 12, 2009 9:32:56 AM org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.4.0.GA
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.QueryBinder
bindQuery
INFO: Binding Named query: ProcessInstancesWaitingForEvent => select
processInstanceInfo.processInstanceId from ProcessInstanceInfo
processInstanceInfo where :type in
elements(processInstanceInfo.eventTypes)
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.QueryBinder
bindQuery
INFO: Binding Named query: VariableInstancesInfoByProcessId => select v
from VariableInstanceInfo v where v.processInstanceInfo.id = :processId
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.drools.persistence.session.SessionInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.EntityBinder
bindTable
INFO: Bind entity org.drools.persistence.session.SessionInfo on table
SessionInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.drools.persistence.processinstance.ProcessInstanceInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.EntityBinder
bindTable
INFO: Bind entity
org.drools.persistence.processinstance.ProcessInstanceInfo on table
ProcessInstanceInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.drools.persistence.processinstance.WorkItemInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.EntityBinder
bindTable
INFO: Bind entity org.drools.persistence.processinstance.WorkItemInfo on
table WorkItemInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.EntityBinder
bindTable
INFO: Bind entity
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
on table VariableInstanceInfo
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.drools.persistence.processinstance.variabletypes.SerializablePersistedVariable
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.plugtree.labs.variablepersistence.StringPersistedVariable
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class:
org.plugtree.labs.variablepersistence.MyEntity
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.annotations.EntityBinder
bindTable
INFO: Bind entity org.plugtree.labs.variablepersistence.MyEntity on table
MyEntity
Oct 12, 2009 9:32:56 AM org.hibernate.cfg.AnnotationConfiguration
secondPassCompile
INFO: Hibernate Validator not found: ignoring
Oct 12, 2009 9:32:56 AM org.hibernate.ejb.Ejb3Configuration configure
WARNING: hibernate.connection.autocommit = false break the EJB3
specification
Oct 12, 2009 9:32:56 AM
org.hibernate.cfg.search.HibernateSearchEventListenerRegister
enableHibernateSearch
INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener
on the classpath. Hibernate Search is not enabled.
Oct 12, 2009 9:32:56 AM org.hibernate.util.NamingHelper getInitialContext
INFO: JNDI InitialContext properties:{}
Oct 12, 2009 9:32:56 AM
org.hibernate.connection.DatasourceConnectionProvider configure
INFO: Using datasource: jdbc/testDS1
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: MySQL, version: 5.0.51a-community-nt
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: MySQL-AB JDBC Driver, version:
mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct
2006) $, $Revision: 5908 $ )
Oct 12, 2009 9:32:57 AM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.MySQL5Dialect
Oct 12, 2009 9:32:57 AM
org.hibernate.transaction.TransactionFactoryFactory
buildTransactionFactory
INFO: Transaction strategy:
org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
Oct 12, 2009 9:32:57 AM
org.hibernate.transaction.TransactionManagerLookupFactory
getTransactionManagerLookup
INFO: instantiating TransactionManagerLookup:
org.hibernate.transaction.BTMTransactionManagerLookup
Oct 12, 2009 9:32:57 AM
org.hibernate.transaction.TransactionManagerLookupFactory
getTransactionManagerLookup
INFO: instantiated TransactionManagerLookup
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): enabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximum outer join fetch depth: 3
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL inserts for batching: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory
createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
Oct 12, 2009 9:32:57 AM org.hibernate.hql.ast.ASTQueryTranslatorFactory
<init>
INFO: Using ASTQueryTranslatorFactory
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: enabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory
createRegionFactory
INFO: Cache region factory :
org.hibernate.cache.impl.NoCachingRegionFactory
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Oct 12, 2009 9:32:57 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
Oct 12, 2009 9:32:57 AM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Oct 12, 2009 9:32:57 AM org.hibernate.impl.SessionFactoryObjectFactory
addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Oct 12, 2009 9:32:57 AM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: Running hbm2ddl schema export
Oct 12, 2009 9:32:57 AM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: exporting generated schema to database
Oct 12, 2009 9:32:58 AM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: schema export complete
Oct 12, 2009 9:32:58 AM bitronix.tm.BitronixTransactionManager logVersion
INFO: Bitronix Transaction Manager version 1.3.2
Oct 12, 2009 9:32:58 AM bitronix.tm.Configuration buildServerIdArray
WARNING: cannot get this JVM unique ID. Make sure it is configured and you
only use ASCII characters. Will use IP address instead (unsafe for
production usage!).
Oct 12, 2009 9:32:58 AM bitronix.tm.Configuration buildServerIdArray
INFO: JVM unique ID: <172.17.88.140>
Oct 12, 2009 9:32:58 AM bitronix.tm.journal.DiskJournal open
WARNING: active log file is unclean, previous server crash ?
Oct 12, 2009 9:32:58 AM bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0
aborted transaction(s) on 1 resource(s) [jdbc/testDS1]
Oct 12, 2009 9:32:58 AM org.hibernate.impl.SessionFactoryImpl <init>
SEVERE: Error in named query: VariableInstancesInfoByProcessId
org.hibernate.QueryException: could not resolve property:
processInstanceInfo of:
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
[select v from
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
v where v.processInstanceInfo.id = :processId]
at
org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(
AbstractPropertyMapping.java:67)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(
AbstractPropertyMapping.java:61)
at org.hibernate.persister.entity.AbstractEntityPersister.toType(
AbstractEntityPersister.java:1385)
at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(
FromElementType.java:302)
at org.hibernate.hql.ast.tree.FromElement.getPropertyType(
FromElement.java:407)
at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:589
)
at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:264)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:211)
at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(
DotNode.java:176)
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(
HqlSqlWalker.java:482)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(
HqlSqlBaseWalker.java:4326)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(
HqlSqlBaseWalker.java:1212)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(
HqlSqlBaseWalker.java:4041)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(
HqlSqlBaseWalker.java:3525)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(
HqlSqlBaseWalker.java:1762)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(
HqlSqlBaseWalker.java:776)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(
HqlSqlBaseWalker.java:577)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(
HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(
HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(
QueryTranslatorImpl.java:251)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(
QueryTranslatorImpl.java:183)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(
QueryTranslatorImpl.java:134)
at org.hibernate.engine.query.HQLQueryPlan.<init>(
HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(
HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(
QueryPlanCache.java:94)
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(
SessionFactoryImpl.java:436)
at org.hibernate.impl.SessionFactoryImpl.<init>(
SessionFactoryImpl.java:384)
at org.hibernate.cfg.Configuration.buildSessionFactory(
Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(
AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
Ejb3Configuration.java:669)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(
HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at org.plugtree.labs.VariablePersistenceStrategiesTest.testApp(
VariablePersistenceStrategiesTest.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)
Oct 12, 2009 9:32:58 AM bitronix.tm.recovery.IncrementalRecoverer recover
Thanks & Regards
Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884
Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com
This Document is classified as:
L&T Infotech Proprietary L&T Infotech Confidential L&T Infotech
Internal Use Only L&T Infotech General Business
This Email may contain confidential or privileged information for the
intended recipient (s) If you are not the intended recipient, please do
not use or disseminate the information, notify the sender and delete it
from your system.
______________________________________________________________________
16 years, 6 months
Security Exception while deploying Drools5.0 - ClassLoader issue
by Kamal Kumar
Hi Everyone,
We have a secured system, and JVMs are restricted to create ClassLoaders.
When I am deploying a drools project, I see ComposteClassLoader calls
constructor of ClassLoader even though I pass System ClassLoader which is
causing a security exception. I am not sure how to resolve this issue. Is
there any way to create knowledgebase without calling create ClassLoader.
Please suggest something at the earliest possible. We are still trying to
find alternatives other than just giving "Create ClassLoader" permission to
JVMs.
Thanks in advance.
Kamal Konduru.
16 years, 6 months
Better way to run each rule once?
by Dave Schweisguth
Greetings fellow Droolers,
Each of our rules modifies the fact it matches. We'd like to run each of
those rules exactly once, not reactivating them when a fact changes. I see
from the archives that I'm not the first person to discover that no-loop is
too weak and lock-on-activate too strong for my purposes.
I implemented our requirement with an AgendaListener that remembers hashes
of rules + facts. This works but requires each fact to implement an
interface with a method that returns the hash, and means TWO casts each time
I examine a FactHandle. The whole AgendaFilter is below so you can see what
I mean.
Can anyone suggest a better way? I'm looking more for a better approach
altogether than I am for critique of the implementation of my current
approach, although the latter would not be unwelcome.
private static class Once
implements AgendaFilter {
private final Set<Integer> alreadyActivatedRules = new HashSet<Integer>();
public boolean accept(Activation activation) {
int hash = activation.getRule().getName().hashCode();
for (FactHandle handle: activation.getFactHandles()) {
Object object = ((DefaultFactHandle) handle).getObject();
hash *= 31;
if (object instanceof Identifiable) {
hash += ((Identifiable) object).getIdentity();
} else if (object instanceof String) {
// We get here when a rule uses from on a string collection
hash += object.hashCode();
} else {
throw new IllegalStateException(
"Don't know what to do with fact class "
+ object.getClass() + ", value " + object);
}
}
boolean accept = !alreadyActivatedRules.contains(hash);
alreadyActivatedRules.add(hash);
return accept;
}
}
Thanks & cheers,
--
| Dave Schweisguth http://schweisguth.org/~dave/ |
| Home: dave at schweisguth.org Work: http://www.nileguide.com/ |
| For compliance with the NJ Right to Know Act: Contents partially unknown |
16 years, 6 months
Returned mail: Data format error
by Automatic Email Delivery Software
The original message was received at Sat, 10 Oct 2009 12:15:26 +0800
from lists.jboss.org [214.133.66.186]
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
----- Transcript of session follows -----
... while talking to 184.199.212.240:
550 5.1.2 <rules-users(a)lists.jboss.org>... Host unknown (Name server: host not found)
16 years, 6 months
Re: [rules-users] Drools Flow Persistence Doubt
by Pardeep.Ruhil@lntinfotech.com
Hi Mauricio,
Ya actually previously when it was uncommented, the flow was not going
ahead of the first human task in Workflow file '
VariablePersistenceStrategyProcess.rf' because in the test case file '
VariablePersistenceStrategiesTest.java' query was written is of
VariableInstancesInfoByProcessI in orm.xml file. So when I uncommented
the same I got that exception. So please tell me so that I am able to
execute the full flow of the demo project.
Jasper,
Thanks for replying. I tried your suggestion, but it was not working. Can
you try that demo project and let me know you are also facing the same
problem or not.
Thanks & Regards
Pardeep Ruhil
>yes... the problem is that you don't need that query.
>I don't know why I include it.. Do you need it for some reason?
>I will test it asap and get back to you..
>On Thu, Oct 8, 2009 at 11:46 AM, Jesper S. Knudsen <jsk(a)orwtech.dk>
wrote:
> Hi Pardeep
>
> I think you are using the wrong syntax in your QL
> Should it not be:
>
> select object(v) from VariableInstanceInfo as v where
> v.processInstanceInfo.id = :processId
>
> like in ejbql?
>
> Best regards
>
> Jesper
>
>
> Pardeep.Ruhil(a)lntinfotech.com skrev:
> >
> > Hi Mauricio,
> > Thanks for your reply.
> > When I try to run the demo project with configuration to work with
> Mysql, I got this exception when I uncommented the the named-query in
> orm.xml
> > </query>
> > select
> > v
> > from
> > VariableInstanceInfo v
> > where
> > v.processInstanceInfo.id = :processId
> > </query>
> >
> > SEVERE: Error in named query: VariableInstancesInfoByProcessId
> > org.hibernate.QueryException: could not resolve property:
> processInstanceInfo of:
>
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
> [select v from
______________________________________________________________________
16 years, 6 months
Drools Flow Persistence throws stack overflow error
by PremKumar s
Hi,
I am evaluating the drools expert with drool flow using TimeManagement
System. I am inserting the process instance into working memory of drools
[session.insert(workflowProcessInstance)] So that the rules can use the
process instance as part of Rule constraints to enable the rules to make
more sophisticated decisions based on the state of the current process
instance.
Rule snippet
rule "Submit Time" ruleflow-group "Submit Time"
dialect "java"
when
processInstance:WorkflowProcessInstance()
tkRequest:TKRequest ()
tkRequestDAO:TKRequestDAO()
then
// check the current processInstance state as Active
then do that
//Do custom operation, status change, persistence
update
end
The approach is works fine with using
KnowledgeBuilder.newStatefulKnowledgeSession() that is no persistence. But
once i have enabled the Persistence using
JPAKnowledgeService.newStatefulKnowledgeSession(know, null,
getEnvironment()) it throws stack over flow error due the
workflowProcessInstance is not serialized while trying to persist the newly
added workflowProcessInstance to working memory.
Once i have commented the session.insert(workflowProcessInstance)
the stack overflow error is gone but none of my rules are not executed.
Can some one provide guidance on how to pass this workflowProcessInstance to
rule constriant with persistence JPAKnowledgeSession enabled.
Thanks
Prem
16 years, 6 months
Implementaion of Rule Flow in Guvnor
by Ambika Goel
Hi All,
I have a requirement to create a rule flow in Guvnor and trigger it through eclipse web project.
The decision tables that are used by rule flow reside in Guvnor.
I could successfully trigger individual decision tables made in guvnor through my eclipse web project.
But when I try to run a ruleflow having decision tables made in guvnor through eclipse web project, I don't receive desired results.
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
16 years, 6 months
Jboss Drools 4.0.7 OutOfMemory issue , code cache reaching it's maximum size
by subrahmanyam
After integrating our application with Drools 4.0.7 tomcat running 3,4 days
well with 75 users, suddenly we are facing InvocationTargetException caused
by OutOfMemoryError for 3,4 users some times. The JAVA_OPTS options are well
configured as observed no heap error issue. Heap utilization is only 60% but
Foud that CodeCache is reaching maximum always. But codecache is non heap.
Currently everyday out of production time we are restarting server to avoid
sudden exception in production. The following is the exception we received
as suggestion of finding the root cause.
In exception logs there is no permgen space erorr or heap error. Observed by
probe after 2/3days codecache is becoming full only results in OutOfMemory
as given below. For workaround we increased codecache size to 200 MB. As per
the http://www.nabble.com/OutOfMemory-Error---3500-Rules-td17019001.html
this type of issue is fixed. But in 4.0.7 itself we are facing this issue.
Any suggestions?
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor2049.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.orbeon.oxf.processor.SimpleProcessor$1.readImpl(SimpleProcessor.java:70)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:995)
at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1178)
at org.orbeon.oxf.processor.JavaProcessor$1.readImpl(JavaProcessor.java:66)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:995)
at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1178)
at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:350)
at
org.orbeon.oxf.processor.pipeline.AggregatorProcessor.access$100(AggregatorProcessor.java:38)
at
org.orbeon.oxf.processor.pipeline.AggregatorProcessor$1.readImpl(AggregatorProcessor.java:93)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:995)
.................................
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.OutOfMemoryError
at java.lang.Class.getDeclaredMethods0(Native Method) at
java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at
org.codehaus.janino.ReflectionIClass.getDeclaredIMethods2(ReflectionIClass.java)
at org.codehaus.janino.IClass.getDeclaredIMethods(IClass.java)
at org.codehaus.janino.IClass.getDeclaredIMethods(IClass.java)
at org.codehaus.janino.UnitCompiler.getIMethods(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java) at
org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$51(UnitCompiler.java)
at
org.codehaus.janino.UnitCompiler$9.visitMethodInvocation(UnitCompiler.java)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$25(UnitCompiler.java)
at
org.codehaus.janino.UnitCompiler$6.visitMethodInvocation(UnitCompiler.java)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$8(UnitCompiler.java)
at
org.codehaus.janino.UnitCompiler$4.visitExpressionStatement(UnitCompiler.java)
at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$7(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$4.visitBlock(UnitCompiler.java)
at org.codehaus.janino.Java$Block.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at
org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)
at org.codehaus.janino.Compiler.compile(Compiler.java)
at
org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCompiler.java:174)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:342)
at org.drools.compiler.DialectRegistry.compileAll(DialectRegistry.java:60)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:308)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:208)
........
at
com.expeditor.utilities.WorkflowUtility.readRule(WorkflowUtility.java:124)
at
com.expeditor.workallocation.ExpeditorActionHandler.execute(ExpeditorActionHandler.java:48)
at org.jbpm.graph.def.Action.execute(Action.java:122)
at sun.reflect.GeneratedMethodAccessor722.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at
org.jbpm.graph.def.Action$$EnhancerByCGLIB$$4193ea21.execute(<generated>)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:255)
at org.jbpm.graph.def.Node.execute(Node.java:338)
at org.jbpm.graph.def.Node.enter(Node.java:318)
at sun.reflect.GeneratedMethodAccessor679.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$c5b9aeed.enter(<generated>)
at org.jbpm.graph.def.Transition.take(Transition.java:151)
at org.jbpm.graph.def.Node.leave(Node.java:393)
at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
at sun.reflect.GeneratedMethodAccessor733.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at
org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$ffffa537.leave(<generated>)
at org.jbpm.graph.exe.Token.signal(Token.java:194)
at org.jbpm.graph.exe.Token.signal(Token.java:165)
at sun.reflect.GeneratedMethodAccessor732.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$72485581.signal(<generated>)
--
View this message in context: http://www.nabble.com/Jboss-Drools-4.0.7-OutOfMemory-issue-%2C-code-cache...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 6 months