- 
        1. Re: How can I query run my own HQL in jBPM 4.x?sebastian.s Oct 27, 2009 3:01 PM (in response to vchira)I thought there was a getter for the Hibernate session object but there is just a setter in ProcessEngine. So if you create the hibernate session on your own and inject it into the Process Engine you can use the same session at the engine. I don't know if there is a reason for the missing getter. 
 http://docs.jboss.com/jbpm/v4/javadocs/org/jbpm/api/ProcessEngine.html
 P.S.: I assumed you were talking about jBPM 4.1.
- 
        2. Re: How can I query run my own HQL in jBPM 4.x?sebastian.s Oct 27, 2009 3:02 PM (in response to vchira)I hate this forum for the impossibility to edit posts to correct typos!! :) 
- 
        3. Re: How can I query run my own HQL in jBPM 4.x?vchira Oct 28, 2009 7:08 AM (in response to vchira)I can't inject the hibernate session.. i am doing this: <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" > <property name="hibernateSession" ref="jbpmSessionFactory"/> </bean> 
 and I get this error:
 Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'hibernateSession' of bean class [org.jbpm.pvm.internal.cfg.SpringConfiguration]: Bean property 'hibernateSession' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
- 
        4. Re: How can I query run my own HQL in jBPM 4.x?sebastian.s Oct 28, 2009 7:14 AM (in response to vchira)I have no clue what could cause the error. I guess somebody more experienced with java beans can answer this. 
 Question to everyone else: Is there a reason that you can set but not get the Hibernate session?
- 
        5. Re: How can I query run my own HQL in jBPM 4.x?vchira Oct 28, 2009 7:16 AM (in response to vchira)wrong copy/paste... i am doing this: <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" > <property name="hibernateSessionFactory" ref="jbpmSessionFactory"/> </bean> 
- 
        6. Re: How can I query run my own HQL in jBPM 4.x?vchira Oct 28, 2009 8:01 AM (in response to vchira)i think i know what is going on. the problem is that zhe hibernateSessionFactory setter is not a valid Java Beans seter.(has a return value). 
 Maybe someone could take a look and make jBPM a bit more Spring friendly.
- 
        7. Re: How can I query run my own HQL in jBPM 4.x?vchira Oct 28, 2009 9:10 AM (in response to vchira)I found the answer. it is actually quite simple. you can write your own Command and execute it . inside the execute Method from the Command you have access to the DBSession and you can execute Hibernate Queries. I will post an Example later on maybe if somone is interested. 
 I am implementing a command that returns a list of Tasks which have a specific name and belong to a process definition with a specific key and have variables with a specific value. maybe a command like this would be useful to everyone and can be integrated in jBPM task service.
- 
        8. Re: How can I query run my own HQL in jBPM 4.x?nilspreusker Oct 28, 2009 11:18 AM (in response to vchira)I'm interested :) 
 Cheers, Nils
- 
        9. Re: How can I query run my own HQL in jBPM 4.x?sebastian.s Oct 28, 2009 1:05 PM (in response to vchira)While browsing JIRA I just found this: 
 https://jira.jboss.org/jira/browse/JBPM-2038
 
     
    