没有合适的资源?快使用搜索试试~ 我知道了~
关于java的资料,学习java的web模块的。
资源详情
资源评论
资源推荐
一、需要导入的包:
1. ${JBPM_HOME}/jbpm.jar(核心包)
2. JBPM_HOME/lib/*.jar , 不 添 加 以 下 jar 包 : servlet-api.jar,
junit.jar。其中 junit.jar 一定不要添加,因为是 3.8.2 版本,与我们使用的
junit4 有冲突。
3. 所使用的数据库对应的驱动的 jar 包(第 2 步所添加的 jar 包中已包含 mysql 的
jdbc 驱动 jar 包)。
二、添加配置文件
1、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.hibernate.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>
2.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="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</
property>
<property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prope
rty>
<property
name="hibernate.connection.url">jdbc:mysql:///jbpm4</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<!-- 其他配置 -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- 导入映射文件 -->
<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.log4j.hibernate.cfg.xml
三、相关资源
1、helloworld.jpdl.xml
2、hellpworld.png
3、helloworld.zip
四、实验:(项目:com.linjw.helloworld)
package com.linjw.helloworld;
import java.util.List;
import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.task.Task;
import org.junit.Test;
@SuppressWarnings("unused")
public class HelloWorld_API {
//建表
@Test
public void createSchem() throws Exception{ //
hbm2ddl.auto=update
new org.hibernate.cfg.Configuration()//
.configure("jbpm.hibernate.cfg.xml")//
.buildSessionFactory();
}
private static ProcessEngine processEngine = new
Configuration()//
.setResource("jbpm.cfg.xml")//
.buildProcessEngine();
//1.部署流程定义:加载流程定义图片与xml的文件
@Test
public void deployProcessDefinition()throws Exception{
processEngine.getRepositoryService()//
.createDeployment()//
.addResourceFromClasspath
("helloworld/helloworld.jpdl.xml")//
.addResourceFromClasspath
("helloworld/helloworld.png")//
.deploy();
}
//2.启动流程:默认的就helloworld的名字
@Test
public void startProcessInstance() throws Exception {
processEngine.getExecutionService().startProcessInstanceByKey(
"helloworld");
}
//3.查询我的个人任务
@Test
public void findMyPersonalTaskList() throws Exception {
剩余18页未读,继续阅读
sshlele
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0