Re: [rules-users] Drools Human Task Service Persistence
wait a minute, is it like no one ever tried persisting human task in oracle before? so far the support is only for H2 in memory db? i wonder how this made into production system then? honestly, its not criticism, just wanted to know how others are doing without persistence of task, of course DB is not only oracle, they might have used other DB as well. But it doesn't ring me a bell how custom status be implemented and how the named queries in org.drools.task be executed, lacking of proper docs and examples ..creating lot of chaos :-( So, you can't do persistence with oracle unless u have to override, if not oracle, what is the best bet DB (please don't say H2 :-) ) -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Human-Task-Service-Persistence-tp1868778p1925280.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rules Flow Eclipse editor
edit your post, in the message box menu, you hve more options picklist, choose this one to upload the file :-) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Rules-Flow-Eclipse-editor-tp1893286p1917905.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Object not seen in working memory i.e not evaluated by rules
Here is my observation, i can see the Ruleflowprocessinstance i.e workflow process loanApprovaltest in my test case but when i debug its not showing in the workingmemory view, i guess that the whole process instance doesn't get into working memory. I guess this could be the reason why rules are not evaluating the objects in the process. But why the process instance is being rejected by working memory... no clue of whatz happening :-( -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Object-not-seen-in-working-memory-i-e-not-evaluated-by-rules-tp1912489p1918510.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Object not seen in working memory i.e not evaluated by rules
Hi I tried to do a simple test case using spring drools. Following is the test class, it inserts customer object into the workflow.rf and fire the rules 1. nameShouldBeEntered 2. emailShouldBeValid I have also attached drl, rf and applicationContext.xml files in this mail. nameShouldBeEntered Rule is fired since its just evaluating to true by default. But emailShouldBeValid rule has not been evaluated if i debug through test case since customer object has not seen in working memory I believe. I added customer variable in RF, also inserted using kession.insert, also passing using paramenter's map in startProcess()...nothing helps... i think its due to some class loader issue or i might be doing some thing wrong in the code...but it looks pretty straight forward and i analyzed the code thoroughly ..could anyone tell me what i am missing in this code? Thanks == package edu.rascalworkflow.test; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.drools.runtime.StatefulKnowledgeSession; import org.drools.runtime.process.ProcessInstance; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import edu.rascalworkflow.model.Account; import edu.rascalworkflow.model.Customer; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={classpath:applicationContextTest.xml}) public final class LoanRequestTest { private static final String PROCESS_LOAN_APPROVAL = loanApproval; @Autowired private StatefulKnowledgeSession ksession; Customer customer; ProcessInstance processInstance; @Test public void testRequestLoan() throws Exception{ customer = new Customer(); customer.setFirstName(null); customer.setLastName(Green); customer.setEmail(null); customer.setUuid(UUID.randomUUID().toString()); Account account = new Account(); account.setAccountNumber(123456789l); customer.addAccount(account); account.setOwner(customer); startProcess(); //System.out.println(customer name: + loanAppHolder.getCustomer().getFirstName()); } private void startProcess() { MapString, Object parameterMap = new HashMapString, Object(); parameterMap.put(customer, customer); try{ processInstance = ksession.startProcess(PROCESS_LOAN_APPROVAL, parameterMap); ksession.insert(customer); ksession.insert(processInstance); ksession.fireAllRules(); }catch(Exception e){ e.printStackTrace(); } } } package edu.rascalworkflow.loan import edu.rascalworkflow.model.* import edu.rascalworkflow.service.* import edu.rascalworkflow.helper.* import org.drools.runtime.process.ProcessInstance global ValidationReport validationReport import function edu.rascalworkflow.helper.ValidationHelper.error; rule nameShouldBeEntered ruleflow-group validateLoan when eval(true) then //c.setFirstName(ERROR); System.out.println(inside firstname rule THEN ***); end rule emailShouldBeValid ruleflow-group validateLoan when c : Customer() then c.setEmail(ERROR); System.out.println(inside email rule THEN ***); end http://drools-java-rules-engine.46999.n3.nabble.com/file/n1912489/applicationContextTest.xml applicationContextTest.xml http://drools-java-rules-engine.46999.n3.nabble.com/file/n1912489/applicationContextTest.xml applicationContextTest.xml http://drools-java-rules-engine.46999.n3.nabble.com/file/n1912489/Customer.java Customer.java http://drools-java-rules-engine.46999.n3.nabble.com/file/n1912489/Account.java Account.java http://drools-java-rules-engine.46999.n3.nabble.com/file/n1912489/loanApproval.rf loanApproval.rf -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Object-not-seen-in-working-memory-i-e-not-evaluated-by-rules-tp1912489p1912489.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org
[rules-users] Is annotation possible in Rule flow constraint editor
Hi I just want to know whether annotation and spring ioc is possible with rule flow constraint editor. For example, in any constraint editor, drools have two supporting types of coding, mvel java. I am wondering like is it possible to choose java and start using java annotation code in textual editor. is it supported? -drooRam. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Is-annotation-possible-in-Rule-flow-constraint-editor-tp1912620p1912620.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Marshalling Error : JBRULES-2453
bump -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Marshalling-Error-JBRULES-2453-tp1792992p1835406.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Marshalling Error : JBRULES-2453
) at org.hibernate.ejb.event.EntityCallbackHandler.preUpdate(EntityCallbackHandler.java:79) at org.hibernate.ejb.event.EJB3FlushEntityEventListener.invokeInterceptor(EJB3FlushEntityEventListener.java:61) at org.hibernate.event.def.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:349) at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:287) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:155) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:76) ... 36 more Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2786) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94) at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847) at java.io.ObjectOutputStream$BlockDataOutputStream.write(ObjectOutputStream.java:1778) at java.io.DataOutputStream.writeInt(DataOutputStream.java:182) at java.io.ObjectOutputStream$BlockDataOutputStream.writeInt(ObjectOutputStream.java:1913) at java.io.ObjectOutputStream.writeInt(ObjectOutputStream.java:777) at org.drools.marshalling.impl.OutputMarshaller.writeLeftTuple(OutputMarshaller.java:482) at org.drools.marshalling.impl.OutputMarshaller.writeLeftTuple(OutputMarshaller.java:466) at org.drools.marshalling.impl.OutputMarshaller.writeInitialFactHandleLeftTuples(OutputMarshaller.java:379) at org.drools.marshalling.impl.OutputMarshaller.writeFactHandles(OutputMarshaller.java:274) at org.drools.marshalling.impl.OutputMarshaller.writeSession(OutputMarshaller.java:102) at org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:133) at org.drools.persistence.session.JPASessionMarshallingHelper.getSnapshot(JPASessionMarshallingHelper.java:72) at org.drools.persistence.session.SessionInfo.update(SessionInfo.java:75) 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.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:37) at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:94) at org.hibernate.ejb.event.EntityCallbackHandler.preUpdate(EntityCallbackHandler.java:79) at org.hibernate.ejb.event.EJB3FlushEntityEventListener.invokeInterceptor(EJB3FlushEntityEventListener.java:61) at org.hibernate.event.def.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:349) at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:287) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:155) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) -drooRam. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Marshalling-Error-JBRULES-2453-tp1792992p1792992.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] ksession.dispose() and DroolsSpringJpaManager.dispose()
bump -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/ksession-dispose-and-DroolsSpringJpaManager-dispose-tp1531549p1644088.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Flow process question...
Hmm that one, i believe to persist the variables during the process flow. so you can work later on the persisted variable based on your use case. sometime you need to halt the process for any approval or some other event, then resume it once the event is triggered, so that time you would be using this registered/persisted variable back to process flow. -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1610943.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Flow process question...
another example: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-flow-variables-don-t-get-passed-to-sub-process-td1609297.html#a1609297 he mentioned that he is using the variable in subflow you can set it using IN/OUT param, registered variable thus can be passed to subflow in this way. -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1610967.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Flow Events Not Working - FIXED
just updating the subject to Fixed, so that it wud be helpful for other users to directly look for solution. -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-Not-Working-tp1453738p1610992.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] ksession.dispose() and DroolsSpringJpaManager.dispose()
anyone out there who successfully invoked ksession.dispose() method in your application code which uses spring jpa transaction manager with drools -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/ksession-dispose-and-DroolsSpringJpaManager-dispose-tp1531549p1592488.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fault node in rule flow
attach a exception handler to the fault node , either log the exception to the file or generate a record to the reporting db. -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Fault-node-in-rule-flow-tp1572596p1592654.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] ksession.dispose() and DroolsSpringJpaManager.dispose()
I have question on kession.dispose(), what is the best place to call this method? I have a code where in i call ksession.startProcess(someprocess, mapParam); ksession.fireAllRules(); finally{ ksession.dispose(); } If i invoke the kession.dispose() like the above, I always ended up in No value bound to the key - Transaction exception. My understanding is that all the calls to drools should be enclosed in a transactional unit. I have done that so. My observation is that DroolsSpringJpaManager.dispose() method is being invoked due to my call to ksession.dispose() after the transaction has begun from my app code and right before the transaction.aftercompletioncommit() call. I can see a line of code in DroolsJpaManager.dispose() method, TransactionSynchronizationManager.unbindResource(this.emf) // entityManagerFactory reference borrowed from application code. My question is that why the above line of code is necessary in dispose() method since this.emf is the reference obtained from Application code jpa manager, since this method unbinded this resource, transaction initiated from the application code is also trying to unbind the same resource once everything is completed results to No value found for this key exception. When i comment out ksession.dispose() call from my app code, it works fine. At this point, i am not sure when to invoke ksession.dispose() call and why the TransactionSynchronizationManager.unbindResource(this.emf) being made in DroolsSpringJpaManager.dispose() on a reference obtained from JpaTransactionManager ? -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/ksession-dispose-and-DroolsSpringJpaManager-dispose-tp1531549p1531549.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] EntityManager is closed - Resolved
In a maven project, keeping drools-persistence-jpa-version.jar in web app lib folder instead from maven repository, solved this issue. but still got a transaction issues with spring and drools... will create a new post on this -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/EntityManager-is-closed-tp1475301p1488151.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Javax.persistence.EntityNotFoundException: No Task with ID 2 was found!
are you using drools with spring hibernate? without jta transaction bitronix , instead trying to access drools using spring jpa transaction manager? if so, did you ever come across the attached error when calling statefulsession.startProcess() on drools within your service method enclosed in aop transaction ? java.lang.IllegalStateException: No value for key [org.springframework.orm.jpa.localcontainerentitymanagerfactoryb...@af198c] bound to thread [http-8080-1] org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:199) org.springframework.orm.jpa.JpaTransactionManager.doCleanupAfterCompletion(JpaTransactionManager.java:525) org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1011) In my case, everything works fine, service method being invoked with aop wrappped txn, drools process is being triggered, persisted to the db using hibernate, but upon exiting the method, i got the exception while after commit transaction. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Javax-persistence-EntityNotFoundException-No-Task-with-ID-2-was-found-tp1453844p1488184.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] EntityManager is closed
thanks for ur reply... But where did u set the env.set (EnvironmentName.CMD_SCOPED_ENTITY_MANAGER, emf.createEntityManager ()); I used the drools:ksession tag in my applicationContext.xml ( spring ) and autowired to my service class which uses the ksession. drools:ksession id=jpaSingleSessionCommandService type=stateful kbase=flowKnowledge drools:configuration drools:jpa-persistence drools:transaction-manager ref=transactionManager / drools:entity-manager-factory ref=entityManagerFactory / drools:variable-persisters drools:persister for-class=javax.persistence.Entity implementation=org.drools.persistence.processinstance.persisters.JPAVariablePersister/ !-- drools:persister for-class=java.lang.String implementation=org.drools.container.spring.beans.persistence.StringVariablePersister/ -- drools:persister for-class=java.io.Serializable implementation=org.drools.persistence.processinstance.persisters.SerializableVariablePersister/ /drools:variable-persisters /drools:jpa-persistence /drools:configuration /drools:ksession if i try to set the env there like env = ksession.getEnvironment(); env.set (EnvironmentName.CMD_SCOPED_ENTITY_MANAGER, emf.createEntityManager ()); It is throwing some runtime exception like SharedEntityManager proxy created by spring is not allowed to join the transaction. I mean the entitymanager created in the above code uses the shared entity proxy wrapped with localcontainer from spring which is not allowed... so,i tried to modify the processinstanceinfo from drools , checked to see entity manager is closed or not, if closed, i created entitymanager there and it kinda solved the problem. I could able to now persist the variables mentioned in the previous mail exception.txt. But got another issue, i wrapped the business service method which calls drools sesssion, start process() etc in AOP transaction with the default transaction attribute, so when the drools process has been persisted and finally spring invokes transactionaftercompletion() which is throwing the following error : its happening only in stateful drools session not with stateless session SEVERE: Servlet.service() for servlet rascalWorkflow threw exception java.lang.IllegalStateException: No value for key [org.springframework.orm.jpa.localcontainerentitymanagerfactoryb...@14994b1] bound to thread [http-8080-2] at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:199) at org.springframework.orm.jpa.JpaTransactionManager.doCleanupAfterCompletion(JpaTransactionManager.java:525) at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1011) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:877) at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:822) at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:392) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:114) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/EntityManager-is-closed-tp1475301p1481469.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How to remove a persisted session from the database ?
I have done something like below to remove the persisted session : SessionInfo si = em.find(SessionInfo.class, sessionId); em.remove(si); call the above lines in a transactional context. its done. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-remove-a-persisted-session-from-the-database-tp1473926p1481588.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] EntityManager is closed
I forgot to mention one important point above, i am not using bitronix in tomcat i am trying to use tomcat with spring transactions and hibernate...no bitronix at all -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/EntityManager-is-closed-tp1475301p1481593.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] EntityManager is closed
Hi I am using the statefulknowledgesession with jpa persistence with spring...exactly configured as per in the section : Example 2.5. JPA configuration for StatefulKnowledgeSessions http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html_single/index.html#d0e47 I am using, spring 3.0.3 release, hibernate 3.5.1, drools 5.1.1. Spring is closing the entity manager upon invoking ksession.startProcess() and got the exception EntityManager is closed , actually in drools, the class org.drools.persistence.processinstance.persisters.JPAVariablePersister is using entitymanager from cmd_scoped_entity_manager ( in my case, it is org.hibernate.ejb.EntityManagerImpl) but this is being closed by spring aop transaction surrounded on my calling method for ksession.startProcess(). Any help would be appreciated... thx I attached the complete stack trace of the exception in this message. http://drools-java-rules-engine.46999.n3.nabble.com/file/n1475301/exception.txt exception.txt -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/EntityManager-is-closed-tp1475301p1475301.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools 5.1 Update Site
I had the same question... see the response from drools team from the below post http://drools-java-rules-engine.46999.n3.nabble.com/Drools-IDE-Update-site-link-for-5-1-CR1-td1009065.html#a1009065 -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-Update-Site-tp1084214p1090663.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] JpaManager - SingleSessionCommandService
Hi, I am using bitronix transaction manager for oracle through tomcat... i have set the transaction manager as follows : bean id=BitronixTransactionManager factory-method=getTransactionManager class=bitronix.tm.TransactionManagerServices destroy-method=shutdown / bean id=transactionManager class=org.springframework.transaction.jta.JtaTransactionManager property name=transactionManager ref=BitronixTransactionManager / property name=userTransaction ref=BitronixTransactionManager / /bean and finally passing this wrapped JtaTransactionManager to drools:ksession tag, the following code has been invoked on SingleSessionCommandService for the transactionManager ... method initTransactionManager() on SingleSessionCommandService.java line # 218. this tm class starts with org.springframework, so it enters this block of code..but it doesn't contains jpa hence JPAManager (jpm) is not being initialized...i cud see the else block is hanging in this code Result : NullPointerException on calling the reference this.jpm. Question is that how should i configure JpaTransactionManager or JtaTransactionManager for Drools ? i think that i followed a correct approach and there is a bug in SingleSessionCommandService.java code? Please advice. Thanks -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/JpaManager-SingleSessionCommandService-tp1090812p1090812.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] GWT Console - Drools Flow problems.
Hi Did u find any solution on this? i am facing the same issue but not on the guvnor, when i tried to use the drools:ksession tag , i have got all the above errors mentioned in your stack trace like... could not commit or rollback session..unable to rollback.. Transaction is already completed...session closed or no session available drools:ksession id=jpaSingleSessionCommandService type=stateful kbase=flowKnowledge drools:configuration drools:jpa-persistence drools:transaction-manager ref=transactionManager / drools:entity-manager-factory ref=entityManagerFactory / drools:variable-persisters drools:persister for-class=javax.persistence.Entity implementation=org.drools.persistence.processinstance.persisters.JPAVariablePersister/ drools:persister for-class=java.io.Serializable implementation=org.drools.persistence.processinstance.persisters.SerializableVariablePersister/ /drools:variable-persisters /drools:jpa-persistence /drools:configuration /drools:ksession It is all from at org.drools.persistence.session.SingleSessionCommandService.init(SingleSessionCommandService.java:130) It really frustrates that i can't get any proper docs/direction available on this. any soln/help wud be much appreciated. Thanks -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/GWT-Console-Drools-Flow-problems-tp998635p1066321.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] MinaTaskClientHandler Reference Object
Thanks for your prompt response Exactly..this is what i pretty much wanted to try out... i referred to the book drools 5 dev guide... It is mentioned that I need to use MinaTaskClientHandler to retrieve task's status like claim, complete, wait e.t.c.. At this point, I am not aware of writing the own client to look for those stauses... can you please shed me some light on this with any available example of writing the own client... I appreciate your help..thx again... -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/MinaTaskClientHandler-Reference-Object-tp1027255p1030205.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] IllegalStateException : DroolsJPAManager while calling session.dispose() method.
i am facing the above problem when i tried to integrate hibernate with drools. Anyone used hibernate with drools? If so, what is the transaction manager setting for hibernate + drools + tomcat i am trying to use the default transaction manager or the jpa transaction manager implementation from springlike the one below... but running into the above error bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean property name=dataSource ref=dataSource / property name=persistenceUnitName value=rascalflow-persistence / property name=persistenceProvider bean class=org.hibernate.ejb.HibernatePersistence / /property property name=jpaVendorAdapter bean id=jpaVendorAdapter class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter property name=database value=ORACLE / property name=showSql value=true / /bean /property property name=jpaPropertyMap map entry key=hibernate.connection.driver_class value=oracle.jdbc.driver.OracleDriver / entry key=hibernate.max_fetch_depth value=3 / entry key=hibernate.hbm2ddl.auto value=update / entry key=hibernate.show_sql value=true / entry key=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect / entry key=hibernate.transaction.factory_class value=org.hibernate.transaction.JDBCTransactionFactory / !--entry key=hibernate.transaction.manager_lookup_class value=org.springframework.transaction.jta.JtaTransactionManager / -- /map /property /bean bean id=transactionManager class=org.springframework.orm.jpa.JpaTransactionManager property name=entityManagerFactory ref=entityManagerFactory / /bean -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/IllegalStateException-DroolsJPAManager-while-calling-session-dispose-method-tp1027858p1030457.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] MinaTaskClientHandler Reference Object
How can I obtain reference to MinaTaskClientHandler through drools config tags? I mean .. we have drools:kbase tag for KnowledgeBase...similarly, do we have anything for MinaTaskClientHandler... I basically need to call the methods, TaskClient.claim, TaskClient.complete etc thro MinaTaskClientHandler.getClient(). Please let me know how can i obtain MinaTaskClientHandler thro config or snippet ? -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/MinaTaskClientHandler-Reference-Object-tp1027255p1027255.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Edit global imports through eclipse plugin
how can i edit global imports in workflow rf file through eclipse plugin... not manually... I would like to add global imports to workflow file through eclipse ?? -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Edit-global-imports-through-eclipse-plugin-tp1027368p1027368.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] NullPointerException on jpaSingleSessionCommandService
I have configured the applicationContext.xml as follows for stateful JPA persistance session - jpaSingleSessionCommandService : drools:ksession id=jpaSingleSessionCommandService type=stateful kbase=flowKnowledge drools:configuration drools:jpa-persistence drools:transaction-manager ref=transactionManager / drools:entity-manager-factory ref=entityManagerFactory / drools:variable-persisters drools:persister for-class=javax.persistence.Entity implementation=org.drools.persistence.processinstance.persisters.JPAVariablePersister/ drools:persister for-class=java.io.Serializable implementation=org.drools.persistence.processinstance.persisters.SerializableVariablePersister/ /drools:variable-persisters /drools:jpa-persistence /drools:configuration /drools:ksession bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean property name=dataSource ref=dataSource / property name=persistenceUnitName value=rascalflow-persistence / property name=persistenceProvider bean class=org.hibernate.ejb.HibernatePersistence / /property property name=jpaVendorAdapter bean id=jpaVendorAdapter class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter property name=database value=ORACLE / property name=showSql value=true / /bean /property /bean bean id=sessionFactory class=org.springframework.orm.hibernate3.LocalSessionFactoryBean p:dataSource-ref=dataSource property name=hibernateProperties value hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver hibernate.hbm2ddl.auto=update hibernate.show_sql=true hibernate.max_fetch_depth=3 hibernate.format_sql=true hibernate.dialect=org.hibernate.dialect.Oracle10gDialect /value /property /bean bean id=sharedEntityManagerBean class=org.springframework.orm.jpa.support.SharedEntityManagerBean property name=entityManagerFactory ref=entityManagerFactory / /bean bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager p:sessionFactory-ref=sessionFactory / When i tried to start the application, i have got Null pointer exception from drools ...Error creating bean with name 'jpaSingleSessionCommandService': ... i know this is something to do with the parameter transaction manager in drools configuration tag... but i have no clue why this error is occuring or any soln It might be the configuration that i have done was incorrect, someone please go through the above configuration and let me know where exactly that I am doing the mistake Basic runtime exception is : Caused by: java.lang.RuntimeException: Could not commit session at org.drools.persistence.session.SingleSessionCommandService.init(SingleSessionCommandService.java:135) ... 52 more Caused by: java.lang.NullPointerException at org.drools.persistence.session.SingleSessionCommandService.init(SingleSessionCommandService.java:124) ... 52 more Aug 5, 2010 3:26:44 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /rascalFlow threw load() exception java.lang.NullPointerException at org.drools.persistence.session.SingleSessionCommandService.init(SingleSessionCommandService.java:124) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:119) at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:57) at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:93) at org.drools.container.spring.beans.StatefulKnowledgeSessionBeanFactory.internalAfterPropertiesSet(StatefulKnowledgeSessionBeanFactory.java:71) at org.drools.container.spring.beans.AbstractKnowledgeSessionBeanFactory.afterPropertiesSet(AbstractKnowledgeSessionBeanFactory.java:93) at
[rules-users] IllegalStateException : DroolsJPAManager while calling session.dispose() method.
Hi I have got the following exception when i tried to call ksession.dispose() method : Does anyone have faced this problem before?? java.lang.IllegalStateException: No value for key [org.springframework.orm.jpa.localcontainerentitymanagerfactoryb...@173898a] bound to thread [http-8080-1] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) root cause java.lang.IllegalStateException: No value for key [org.springframework.orm.jpa.localcontainerentitymanagerfactoryb...@173898a] bound to thread [http-8080-1] org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:199) org.drools.container.spring.beans.persistence.DroolsSpringJpaManager.dispose(DroolsSpringJpaManager.java:75) org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:296) org.drools.command.impl.CommandBasedStatefulKnowledgeSession.dispose(CommandBasedStatefulKnowledgeSession.java:181) edu.rascalflow.service.impl.LoanApprovalServiceImpl.requestLoan(LoanApprovalServiceImpl.java:59) edu.rascalflow.service.impl.BankingServiceImpl.requestLoan(BankingServiceImpl.java:62) edu.rascalflow.controller.LoanRequestFormController.onSubmit(LoanRequestFormController.java:31) org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:387) org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:272) org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268) org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/IllegalStateException-DroolsJPAManager-while-calling-session-dispose-method-tp1027858p1027858.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools-Spring Schema location changed ????
Alright, the xsd error still remains though but I could able to successfully integrate drools 5.1 CR1 with spring 3.0.3. I got the spring namespace handler exception when i tried to use drools-spring.5.1.jar with DRE 5.0, which is not appropriate. So, i completely checked out DRE 5.1. CR1, used the spring config above. its a plain vanilla integration :-) -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Spring-Schema-location-changed-tp833916p1016671.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Accessing spring beans
Alright, the xsd error still remains though but I could able to successfully integrate drools 5.1 CR1 with spring 3.0.3. I got the spring name space handler exception when i tried to use drools-spring.5.1.jar with DRE 5.0, which is not appropriate. So, i completely checked out DRE 5.1. CR1, its a plain vanilla integration ... drools:resource-ref tag is not working but i cud use drools:resource tag within kbase. Thanks Optimus :-) -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Accessing-spring-beans-tp980991p1016692.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Accessing spring beans
Optimus, I have a quick question on this. when u say that u hve done a poc with drools-spring integration, didn't you face the issue in spring config file when u try to define drools tag? Issue like ... Referenced drools-spring.xsd schema contains errors with parsing exception though the drools-spring.xsd in the classpath... If you wud hve encountered this issue and managed to solve, please post the solution... i got stuck with this issue as drools tag not been recognized by parser due to xmlns:drools=http://drools.org/schema/drools-spring; . -drooRam -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Accessing-spring-beans-tp980991p1009031.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools-Spring Schema location changed ????
drools-spring.xsd is in the eclipse classpath... am facing the same problem like Referenced file contains errors (http://drools.org/schema/drools-spring.xsd). For more information, right click on the message in the Problems View and select Show Details... The above error is stopping me to integrate drools with spring. Any solution on this If so, please post it. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Spring-Schema-location-changed-tp833916p1002244.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools-Spring Schema location changed ????
drools-spring.xsd is in the eclipse classpath... am facing the same problem like Referenced file contains errors (http://drools.org/schema/drools-spring.xsd). For more information, right click on the message in the Problems View and select Show Details... The above error is stopping me to integrate drools with spring. Any solution on this If so, please post it. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Spring-Schema-location-changed-tp833916p1002689.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users