在SSH2项目中添加JBPM4的开发环境
来源:互联网 发布:我想在淘宝开店 编辑:程序博客网 时间:2024/06/05 08:08
1.导入JBPM4开发所需的jar包,注意不要和原有的SSH2jar包冲突,启动tomcat,如果正常,则进行下一步的操作
2.将下面的JBPM4的映射文件代码,写入到hibernate.cfg.xml配置文件中:
<!-- 导jpbm入映射文件 --><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" />
使得hibernate.cfg.xml的内容大致如下:
<pre name="code" class="java"><?xml version="1.0"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration><session-factory><!-- 数据库信息(连接信息写到spring的配置文件中) --><property name="dialect">org.hibernate.dialect.MySQL5Dialect</property><!-- <property name="connection.url">jdbc:mysql:///itcastoa_20120216</property><property name="connection.driver_class">com.mysql.jdbc.Driver</property><property name="connection.username">root</property><property name="connection.password">root</property>--><!-- 其他配置 --><property name="show_sql">true</property><property name="hbm2ddl.auto">update</property><!-- 导入映射配置 --><mapping resource="cn/itcast/oa/domain/User.hbm.xml" /><mapping resource="cn/itcast/oa/domain/Department.hbm.xml" /><mapping resource="cn/itcast/oa/domain/Role.hbm.xml" /><mapping resource="cn/itcast/oa/domain/Privilege.hbm.xml" /><mapping resource="cn/itcast/oa/domain/Forum.hbm.xml" /><mapping resource="cn/itcast/oa/domain/Topic.hbm.xml" /><mapping resource="cn/itcast/oa/domain/Reply.hbm.xml" /> <!-- 导jpbm入映射文件 --><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" /></session-factory></hibernate-configuration>
3.将JBPM4中jbpm.cfg.xml的 <import resource="jbpm.tx.hibernate.cfg.xml" />,改成 <import resource="jbpm.tx.spring.cfg.xml" />
<pre name="code" class="java">jbpm.cfg.xml内容如下:
<pre name="code" class="java"><?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.hibernate.cfg.xml" /> --> <!-- 与Spring整合需要导入jbpm.tx.spring.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>
将该文件放在src目录下
4.在applicationContext.xml中添加下面代码:
<pre name="code" class="html"> <!-- 配置ProcessEngine --><bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper"><property name="jbpmCfg" value="jbpm.cfg.xml"></property></bean><bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />
5.测试
<pre name="code" class="java">// 测试SessionFactory@Testpublic void testSessionFactory() throws Exception {SessionFactory sessionFactory = (SessionFactory) ac.getBean("sessionFactory");System.out.println(sessionFactory);}
<strong><span style="font-size:24px;">在SSH2项目中添加JBPM4的开发环境完成</span></strong>
0 0
- 在SSH2项目中添加JBPM4的开发环境
- JBPM4.4整合SSH2项目
- JBPM4工作流之在myecplsie中安装jBPM4.0开发插件以及JBPM4的简单介绍和入门
- ssh2 + jbpm4.4+ myflow-min示例项目
- 在SSH2开发中需要注意的一个小问题。
- JBPM4入门——3.JBPM4开发环境的搭建
- myeclipse搭建SSH2环境的项目引用
- 搭建SSH2的集成开发环境
- 搭建ssh2协议的开发环境
- ssh2+jbpm4.4项目 审批流转:审批流程管理的思路
- iOS开发在项目中添加文件夹的步骤
- 在iOS开发中,给项目添加新的.framework
- 在Linux中布Java项目的开发环境
- JBPM4.4+SSH2 Demo
- 在SSH2项目中实现使用Freemark导出Word文档
- ueditor jsp版 在SSH2项目中使用小结
- SSH2整合项目开发中spring配置文件applicationContext.xml分析
- SSH2整合项目开发中spring配置文件applicationContext.xml分析
- oracle 制造数据1000万条
- YouTube转向Amazon的推荐算法 | Resys China
- 浅谈数据库的完整性
- Unity3D 学习笔记(四) Unity连接MySQL数据库
- 【Android】 分享一个完整的项目,适合新手!
- 在SSH2项目中添加JBPM4的开发环境
- 二叉树2
- Java设计模式初解 之 单例模式
- 黑马程序员——GUI-网络编程-反射
- JavaMelody监控spring、struts
- 泛型
- unix下ftp传输大文件问题请教
- 【C#网络编程系列】专题十二:实现一个简单的FTP服务器
- 多叉树转二叉树