Java瑣事
-I am not alone
posts - 54, comments - 30, trackbacks - 0, articles - 1
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
手動發布流程定義(jbpm3)
Posted on 2011-04-27 17:19
石子路口
閱讀(1761)
評論(0)
編輯
收藏
所屬分類:
工作流
上一個文章介紹了在啟動tomat服務的時候自動發布流程。這里介紹如何手動的把定義好的processdefinition.xml持久化到數據庫中。這里使用的是junit測試代碼
1. 建兩個包cn.edu.ujn.wsjx.test.process以及cn.edu.ujn.wsjx.test.service
2. 在service包中新建測試基類BaseServiceTest.java
1
package
cn.edu.ujn.wsjx.test.service;
2
3
import
org.springframework.context.ApplicationContext;
4
import
org.springframework.context.support.ClassPathXmlApplicationContext;
5
6
import
junit.framework.TestCase;
7
8
public
class
BaseServiceTest
extends
TestCase
9
{
10
protected
ApplicationContext context;
11
12
public
ApplicationContext getApplicationContext()
13
{
14
return
context;
15
}
16
17
@Override
18
protected
void
setUp()
throws
Exception
19
{
20
//
TODO Auto-generated method stub
21
super
.setUp();
22
23
context
=
new
ClassPathXmlApplicationContext(
new
String[]
24
{
"
spring/applicationContext.xml
"
,
"
spring/applicationContext-jbpm.xml
"
,
25
"
spring/applicationContext-shi.xml
"
,
"
spring/applicationContext-wu.xml
"
,
26
"
spring/applicationContext-zhou.xml
"
,
"
spring/daoContext.xml
"
}
);
27
}
28
}
29
3. 在包process中新建類ProcessDeployTest繼承上面的類
package
cn.edu.ujn.wsjx.test.process;
import
java.io.File;
import
java.io.FileInputStream;
import
java.io.FileNotFoundException;
import
java.util.zip.ZipInputStream;
import
org.jbpm.JbpmConfiguration;
import
org.jbpm.JbpmContext;
import
org.jbpm.graph.def.ProcessDefinition;
import
cn.edu.ujn.wsjx.test.service.BaseServiceTest;
public
class
ProcessDeployTest
extends
BaseServiceTest
{
public
void
testAddProcessDefinition()
{
JbpmConfiguration jbpmConfiguration
=
(JbpmConfiguration)context.getBean(
"
jbpmConfiguration
"
);
JbpmContext jbpmContext
=
jbpmConfiguration.createJbpmContext();
try
{
File file
=
new
File(
"
E:/work/work.zip
"
);
FileInputStream fis
=
new
FileInputStream(file);
ZipInputStream zip
=
new
ZipInputStream(fis);
ProcessDefinition processDefinition
=
ProcessDefinition.parseParZipInputStream(zip);
jbpmContext.deployProcessDefinition(processDefinition);
}
catch
(FileNotFoundException e)
{
e.printStackTrace();
}
finally
{
jbpmContext.close();
}
}
public
void
testDestroyProcess()
{
JbpmConfiguration jbpmConfiguration
=
(JbpmConfiguration)context.getBean(
"
jbpmConfiguration
"
);
JbpmContext jbpmContext
=
jbpmConfiguration.createJbpmContext();
jbpmContext.getGraphSession().deleteProcessDefinition(
1
);
jbpmContext.close();
}
}
說明:testAddProcessDefinition()是發布流程定義的zip包到數據庫中,testDestroyProcess()是通過數據庫中存儲的流程id刪除相應的流程
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
學習大雜燴
手動發布流程定義(jbpm3)
把jbpm3整合進ssh中
把jbpm-jpdl-3.2.3中的實例部署到tomcat中
jbpm3數據庫表的創建與解釋
初始bpm的現狀
Powered by:
BlogJava
Copyright © 石子路口
日歷
<
2011年4月
>
日
一
二
三
四
五
六
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
ajax
flex(1)
hibernate
Java(3)
spring
struts2(2)
工作流(6)
數據庫(1)
校外項目(2)
網絡教學資源平臺(31)
網頁制作(5)
記錄(5)
設計模式(1)
隨筆檔案
2011年5月 (3)
2011年4月 (5)
2011年3月 (3)
2010年11月 (9)
2010年10月 (24)
2010年9月 (10)
搜索
最新評論
1.?re: flex3的在myeclipse6.5中部署及第一個實例
sdfsdf
--safd
2.?re: 學習大雜燴
@黑蝙蝠
樓主自己都沒有搞醒豁,TA咋個好意思分享他自己的經驗和成果嘛!
--ocaicai
3.?re: 學習大雜燴
可以分享學習成果么~~
--黑蝙蝠
4.?re: 學習大雜燴
樓主的知識面真夠廣的...膜拜中。。。
--http://ask.zhongguoren.me
5.?re: 4月22日
這個是關于什么的文章
--新能源
閱讀排行榜
1.?"java.net.BindException: Cannot assign requested address"竟是瑞星防火墻所為(4193)
2.?struts2中select標簽的用法總結(3851)
3.?關于myeclipse和mysql中文亂碼問題(10月11日)(2783)
4.?hibernate的單向級聯刪除問題(2685)
5.?FCKeditor支持jsp的配置(myeclipse工具)(2585)
評論排行榜
1.?小心數據庫字段與關鍵字重復問題(4)
2.?"java.net.BindException: Cannot assign requested address"竟是瑞星防火墻所為(3)
3.?頁面中有幾個form(3)
4.?學習大雜燴(3)
5.?java處理excel(3)
主站蜘蛛池模板:
亚洲视频在线观看网站
|
亚洲综合国产一区二区三区
|
无码人妻一区二区三区免费
|
成人免费一区二区三区在线观看
|
色吊丝最新永久免费观看网站
|
免费观看国产小粉嫩喷水
|
亚洲熟妇无码AV在线播放
|
亚洲一区二区影院
|
日韩亚洲综合精品国产
|
男人进去女人爽免费视频国产
|
在线观看免费视频资源
|
免费萌白酱国产一区二区
|
亚洲第一se情网站
|
亚洲午夜精品第一区二区8050
|
亚洲福利电影在线观看
|
久久不见久久见免费影院www日本 久久WWW免费人成—看片
|
亚洲最大视频网站
|
亚洲欧美在线x视频
|
亚洲欧洲一区二区三区
|
亚洲精品中文字幕无乱码麻豆
|
一级做a爱过程免费视
|
日本成年免费网站
|
亚洲Av无码精品色午夜
|
亚洲GV天堂GV无码男同
|
亚洲免费一级视频
|
亚洲福利在线观看
|
亚洲精品黄色视频在线观看免费资源
|
免费国产黄线在线观看
|
亚洲精品自产拍在线观看动漫
|
美女被艹免费视频
|
在线看片v免费观看视频777
|
久久久久久久亚洲Av无码
|
久久久国产精品无码免费专区
|
日本特黄a级高清免费大片
|
亚洲国产精品一区二区久
|
手机看片国产免费永久
|
又粗又硬又大又爽免费视频播放
|
亚洲香蕉在线观看
|
亚洲国产婷婷香蕉久久久久久
|
青青草无码免费一二三区
|
亚洲福利视频一区
|