Avneesh Sisodia [
https://community.jboss.org/people/avneesh] created the discussion
"Re: JBPM(Human Task)+Spring+Hibernate on JBoss AS 7"
To view the discussion, visit:
https://community.jboss.org/message/760755#760755
--------------------------------------------------------------
Yes I have all thses kbase and ksession etc. in my application context.
here is my applicationContext.xml
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName"
value="java:jboss/TransactionManager"/>
</bean>
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:jboss/datasources/RI"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="jpaVendorAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
<!-- <property name="database" value="MSSQL" />
-->
<property name="generateDdl" value="true" />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="jbpm" />
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter" ref="jpaVendorAdapter"
/>
</bean>
<bean id="systemEventListener"
class="org.drools.SystemEventListenerFactory"
factory-method="getSystemEventListener" />
<bean id="taskService"
class="org.jbpm.task.service.TaskService" >
<property name="systemEventListener"
ref="systemEventListener" />
</bean>
<bean id="springTaskSessionFactory"
class="org.jbpm.task.service.persistence.TaskSessionSpringFactoryImpl"
scope="prototype">
<property name="entityManagerFactory"
ref="entityManagerFactory" />
<property name="useJTA" value="true" />
<property name="taskService" ref="taskService" />
</bean>
<bean id="taskServiceSetup"
class="com.nijhazer.jbpm.quickstart.TaskServiceSetup"
init-method="initialize">
<!-- <constructor-arg type="org.jbpm.task.service.TaskService"
value="taskService" />
<constructor-arg
type="org.springframework.transaction.support.AbstractPlatformTransactionManager"
value="transactionManager" />
-->
<property name="taskService" ref="taskService" />
<property name="taskResources" ref="taskResourceFactory"
/>
<property name="roles" ref="listRoles" />
<property name="users" ref="listUsers" />
</bean>
<bean id="taskResourceFactory"
class="com.nijhazer.jbpm.quickstart.TaskResourceFactory"
factory-method="getTaskClient">
<constructor-arg type="org.jbpm.task.service.TaskService"
value="taskService" />
<constructor-arg
type="org.springframework.transaction.support.AbstractPlatformTransactionManager"
value="transactionManager" />
</bean>
<bean id="roleAdmin"
class="com.nijhazer.jbpm.quickstart.model.AccountRole">
<constructor-arg type="java.lang.String"
value="Administrator" />
</bean>
<bean id="roleNormal"
class="com.nijhazer.jbpm.quickstart.model.AccountRole">
<constructor-arg type="java.lang.String" value="Normal"
/>
</bean>
<bean id="listRoles" class="java.util.ArrayList">
<constructor-arg>
<list>
<ref bean="roleAdmin" />
<ref bean="roleNormal" />
</list>
</constructor-arg>
</bean>
<bean id="listUsers" class="java.util.ArrayList">
<constructor-arg>
<list>
<bean
class="com.nijhazer.jbpm.quickstart.model.AccountUser">
<constructor-arg type="java.lang.String"
value="Administrator" />
<constructor-arg
type="com.nijhazer.jbpm.quickstart.model.AccountRole" ref="roleAdmin"
/>
</bean>
<bean
class="com.nijhazer.jbpm.quickstart.model.AccountUser">
<constructor-arg type="java.lang.String"
value="NormalGuy" />
<constructor-arg
type="com.nijhazer.jbpm.quickstart.model.AccountRole" ref="roleNormal"
/>
</bean>
</list>
</constructor-arg>
</bean>
<jbpm:kbase id="kbase">
<jbpm:resources>
<jbpm:resource
source="classpath:bpmn/SampleHumanTaskProcess.bpmn"
type="BPMN2"></jbpm:resource>
</jbpm:resources>
</jbpm:kbase>
<bean id="txManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory"
ref="entityManagerFactory" />
</bean>
<bean id="ksessionFactory"
class="com.nijhazer.jbpm.quickstart.KnowledgeSessionFactory">
<property name="entityManagerFactory"
ref="entityManagerFactory" />
<property name="kbase" ref="kbase" />
<property name="transactionManager"
ref="transactionManager" />
<property name="taskResources" ref="taskResourceFactory"
/>
</bean>
<drools:ksession id="ksession" type="stateful"
kbase="kbase">
<drools:configuration>
<drools:jpa-persistence>
<drools:transaction-manager ref="txManager" />
<drools:entity-manager-factory ref="entityManagerFactory"
/>
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
<!-- Component scan -->
<context:component-scan base-package="com.nijhazer.jbpm.quickstart"
/>
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/760755#760755]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]