零全零美(www.zzgwt.com)
生活中的很多事情,并不像If...Else那么簡單!
BlogJava
首頁
新文章
聯(lián)系
管理
posts - 96,comments - 52,trackbacks - 0
<
2011年2月
>
日
一
二
三
四
五
六
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
1
2
3
4
5
6
7
8
9
10
11
12
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
隨筆分類
apache組件(4)
JavaScript(14)
jbpm(6)
oracle(5)
PL/SQL(1)
SEO(3)
tomcat(5)
ubuntu(16)
安全相關(guān)(26)
數(shù)據(jù)庫
正則表達(dá)式(6)
設(shè)計模式(3)
隨筆檔案
2012年9月 (1)
2012年7月 (3)
2012年6月 (2)
2009年11月 (36)
2009年10月 (18)
2009年9月 (1)
2009年2月 (1)
2009年1月 (1)
2008年11月 (9)
2008年9月 (1)
2008年8月 (1)
2008年7月 (4)
2008年6月 (2)
2008年5月 (6)
2008年4月 (11)
友情鏈接
www.modaotea.com
茶藝培訓(xùn) 茶樓管理
www.website371.com
鄭州做網(wǎng)站 鄭州網(wǎng)站建設(shè) 鄭州做網(wǎng)站公司 鄭州網(wǎng)站優(yōu)化 鄭州網(wǎng)站制作
河南省大井科技有限公司(www.zzgwt.com)
搜索
積分與排名
積分 - 151579
排名 - 405
最新評論
1.?re: 正則表達(dá)式學(xué)習(xí)筆記(1) 行的開始和結(jié)束、字符組、連字符、脫字符、用"."去匹配任意字符
贊
--性感電子
2.?re: Apache httpd+Jk+Tomcat實現(xiàn)JAVA服務(wù)器配置全解析(1):基礎(chǔ)環(huán)境搭建
什么嘛,我就是不懂這些才搜索的,我最需要的就是你省略的部分,如何配置安裝,唉,又得繼續(xù)找資料了。
--吐槽
3.?re: JavaScript學(xué)習(xí)筆記(1)變量的生命周期
寫的很好
--fwd
4.?re: SELinux學(xué)習(xí)(1):Can't connect to MySQL server on 'ip' (13) 的解決方案
沒玩過這東西啊呵呵
--臺式萬用表
5.?re: [原創(chuàng)]巧用System.getProperty()編譯現(xiàn)有工程的java文件
你不能用ANT嗎?
--DB Compare Tool
JBPM實踐之:使用Fork中的Script實現(xiàn)多路路由選擇
在閱讀本文之前,建議先閱讀一下《
JBPM源碼解讀之:Fork
》以了解Fork中Script的配置方法及處理方式:
按照Fork對Script的規(guī)范Script必須包含一個具有write權(quán)限的變量,而且該變量必須實現(xiàn)java.util.Collection接口。
<?
xml version="1.0" encoding="UTF-8"
?>
<
process-definition
xmlns
="urn:jbpm.org:jpdl-3.2"
name
="multiChoice"
>
<
start-state
name
="start"
>
<
transition
name
=""
to
="a"
></
transition
>
</
start-state
>
<
task-node
name
="a"
>
<
event
type
="node-enter"
>
<
script
>
System.out.println("---enter node a--");
</
script
>
</
event
>
<
transition
name
=""
to
="multichoice"
></
transition
>
</
task-node
>
<
fork
name
="multichoice"
>
<
script
>
<
variable
name
="transitionNames"
access
="write"
></
variable
>
<
expression
>
transitionNames = new ArrayList();
if ( scenario == 1 ){
transitionNames.add( "to b" );
} else if ( scenario ==2 ) {
transitionNames.add( "to c" );
} else if (scenario >= 3 ) {
transitionNames.add( "to b" );
transitionNames.add( "to c" );
}
</
expression
>
</
script
>
<
event
type
="node-enter"
>
<
script
>
System.out.println("---enter node fork--");
</
script
>
</
event
>
<
transition
name
="to b"
to
="b"
></
transition
>
<
transition
name
="to c"
to
="c"
></
transition
>
</
fork
>
<
task-node
name
="b"
>
<
event
type
="node-enter"
>
<
script
>
System.out.println("---enter node b--");
</
script
>
</
event
>
<
transition
name
=""
to
="syncmerge"
></
transition
>
</
task-node
>
<
task-node
name
="c"
>
<
event
type
="node-enter"
>
<
script
>
System.out.println("---enter node c--");
</
script
>
</
event
>
<
transition
name
=""
to
="syncmerge"
></
transition
>
</
task-node
>
<
join
name
="syncmerge"
>
<
event
type
="node-enter"
>
<
script
>
System.out.println("---enter node syncmerge--");
</
script
>
</
event
>
<
transition
name
=""
to
="end"
></
transition
>
</
join
>
<
end-state
name
="end"
>
<
event
type
="node-enter"
>
<
script
>
System.out.println("---enter node end--");
</
script
>
</
event
>
</
end-state
>
</
process-definition
>
附上單元測試代碼:
import
junit.framework.TestCase;
import
org.jbpm.graph.def.ProcessDefinition;
import
org.jbpm.graph.exe.ProcessInstance;
import
org.junit.After;
import
org.junit.Before;
import
org.junit.Test;
public
class
TestFork
extends
TestCase
{
private
ProcessDefinition processDefinition;
@Before
public
void
setUp()
throws
Exception
{
String xmlPath
=
"
jbpmTest/fork/jpdl/fork.xml
"
;
processDefinition
=
ProcessDefinition.parseXmlResource(xmlPath);
}
@After
public
void
tearDown()
throws
Exception
{
}
@Test
public
void
test()
{
ProcessInstance processInstance
=
new
ProcessInstance(processDefinition);
//
processInstance.getContextInstance().setVariable("scenario", new Integer(1));
//
processInstance.getContextInstance().setVariable("scenario", new Integer(2));
processInstance.getContextInstance().setVariable(
"
scenario
"
,
new
Integer(
3
));
processInstance.signal();
}
}
posted on 2008-11-05 17:05
零全零美
閱讀(1923)
評論(4)
編輯
收藏
所屬分類:
jbpm
FeedBack:
#
re: JBPM實踐之:使用Fork中的Script實現(xiàn)多路路由選擇[未登錄]
2009-07-14 10:36 |
zhang
你好。我的運行報錯。好像是這個地方。
<script>
<variable name="transitionNames" access="write"></variable>
<expression>
transitionNames=new ArrayList();
if(scenario==1){
transitionNames.add("to b" );
}else if ( scenario ==2 ) {
transitionNames.add( "to c" );
}else if (scenario >= 3) {
transitionNames.add( "to b" );
transitionNames.add("to c" );
}
</expression>
</script>
錯誤提示:
10:33:04,453 [main] WARN Script : exception during evaluation of script expression
Sourced file: inline evaluation of: ``transitionNames=new ArrayList(); if(scenario==1){ transitionNames.add("to b" ); . . . '' : illegal use of undefined variable, class, or 'void' literal : at Line: 1 : in file: inline evaluation of: ``transitionNames=new ArrayList(); if(scenario==1){ transitionNames.add("to b" ); . . . '' : ) {
回復(fù)
更多評論
#
re: JBPM實踐之:使用Fork中的Script實現(xiàn)多路路由選擇
2009-08-03 14:32 |
tomc
要怎么解決?
回復(fù)
更多評論
#
re: JBPM實踐之:使用Fork中的Script實現(xiàn)多路路由選擇
2009-08-17 21:42 |
阿斯頓
我也遇到了和樓上一樣的問題,請問該如何解決呢?等待中。。。
回復(fù)
更多評論
#
re: JBPM實踐之:使用Fork中的Script實現(xiàn)多路路由選擇
2011-02-23 14:38 |
鄭院生
我的也是這個問題 不過我的是因為出了個小錯 解釋把 access=“write” 寫成了acess=“write”,修改以后就沒事了 民可以再仔細(xì)檢查一下自己的源碼,僅供參考
回復(fù)
更多評論
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發(fā)表評論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
[原創(chuàng)]巧用System.getProperty()編譯現(xiàn)有工程的java文件
[原創(chuàng)]JBPM源碼解讀之:Join
[原創(chuàng)]JBPM實踐之:并發(fā)子流程的實現(xiàn)
JBPM實踐之:使用Fork中的Script實現(xiàn)多路路由選擇
[原創(chuàng)]JBPM源碼解讀之:Fork
JBPM實踐之:在流程圖上高亮顯示指定的任務(wù)節(jié)點
Copyright ©2025 零全零美 Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
国产精品亚洲精品日韩电影
|
欧美男同gv免费网站观看
|
一区二区三区在线免费看
|
国产yw855.c免费视频
|
久久精品国产亚洲av日韩
|
杨幂最新免费特级毛片
|
成人免费777777
|
亚洲综合无码AV一区二区
|
免费人成动漫在线播放r18
|
亚洲高清在线观看
|
黄色网页免费观看
|
亚洲精品A在线观看
|
美女视频免费看一区二区
|
亚洲人成电影福利在线播放
|
日韩视频免费在线
|
亚洲AV成人一区二区三区观看
|
亚洲第一网站男人都懂
|
亚洲理论片中文字幕电影
|
久久久久成人片免费观看蜜芽
|
亚洲日韩国产二区无码
|
国产无人区码卡二卡三卡免费
|
亚洲韩国—中文字幕
|
国产成人精品免费直播
|
一级做a爱片特黄在线观看免费看
|
凹凸精品视频分类国产品免费
|
日韩免费的视频在线观看香蕉
|
亚洲乱码中文字幕综合
|
亚洲人成色77777在线观看
|
亚洲无线观看国产精品
|
免费看男女下面日出水视频
|
8x8x华人永久免费视频
|
中文字幕亚洲综合精品一区
|
久草视频在线免费
|
亚洲熟妇无码AV不卡在线播放
|
国产片AV片永久免费观看
|
久久亚洲AV无码精品色午夜麻豆
|
国产亚洲精品福利在线无卡一
|
四虎影院免费视频
|
最近免费2019中文字幕大全
|
黄色片免费在线观看
|
亚洲中文字幕在线无码一区二区
|