ssh+jbpm整合代码示例

来源:互联网 发布:房卡游戏源码 编辑:程序博客网 时间:2024/05/17 07:46

jbpm.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
  <import resource="jbpm.default.cfg.xml" />
  <import resource="jbpm.businesscalendar.cfg.xml" />
  <import resource="jbpm.tx.spring.cfg.xml" />
  <import resource="jbpm.jpdl.cfg.xml" />
  <import resource="jbpm.bpmn.cfg.xml" />
  <import resource="jbpm.identity.cfg.xml" />
  <!-- Job executor is excluded for running the example test cases. -->
  <!-- To enable timers and messages in production use, this should be included. -->
  <!--
  <import resource="jbpm.jobexecutor.cfg.xml" />
  -->
</jbpm-configuration>

-----------------------------------------------------------------------------------------------------------------------

jbpm.hibernate.cfg.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/oa0909
</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">mysql</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<!-- 
<property name="current_session_context_class">thread</property>
-->
<mapping resource="cn/itcast/oa0909/domain/Person.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Department.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Post.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/User.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Menuitem.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Kynamic.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Version.hbm.xml" />

<mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.identity.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Approve.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/Form.hbm.xml" />
<mapping resource="cn/itcast/oa0909/domain/FormTemplate.hbm.xml" />

</session-factory>
</hibernate-configuration>

-----------------------------------------------------------------------------------------------------------------------------------

applicationcontext-db.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/aop 
                           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context-2.5.xsd
                           http://www.springframework.org/schema/tx 
                           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- 导入类扫描的注解解析器和事务的注解解析器 -->
<context:component-scan base-package="cn.itcast.oa0909"></context:component-scan>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:jbpm/jbpm.hibernate.cfg.xml</value>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- 产生processEngine -->
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
<property name="jbpmCfg" value="jbpm/jbpm.cfg.xml"></property>
</bean>
<bean id="processEngine" factory-bean="springHelper"
factory-method="createProcessEngine" />
</beans>



原创粉丝点击