Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
f8046365
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f8046365
编写于
5月 16, 2013
作者:
T
Tijs Rademakers
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #59 from henningp/master
#ACT-1426: Nested multi-instance activities did not work
上级
ad909198
a59c47b2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
85 addition
and
1 deletion
+85
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java
...ine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java
+5
-1
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.java
...iti/engine/test/bpmn/multiinstance/MultiInstanceTest.java
+22
-0
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.testNestedMultiInstanceTasks.bpmn20.xml
...MultiInstanceTest.testNestedMultiInstanceTasks.bpmn20.xml
+58
-0
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java
浏览文件 @
f8046365
...
...
@@ -84,7 +84,7 @@ public abstract class MultiInstanceActivityBehavior extends FlowNodeActivityBeha
}
public
void
execute
(
ActivityExecution
execution
)
throws
Exception
{
if
(
getLoopVariable
(
execution
,
LOOP_COUNTER
)
==
null
)
{
if
(
getLo
calLo
opVariable
(
execution
,
LOOP_COUNTER
)
==
null
)
{
try
{
createInstances
(
execution
);
}
catch
(
BpmnError
error
)
{
...
...
@@ -227,6 +227,10 @@ public abstract class MultiInstanceActivityBehavior extends FlowNodeActivityBeha
}
return
(
Integer
)
value
;
}
protected
Integer
getLocalLoopVariable
(
ActivityExecution
execution
,
String
variableName
)
{
return
(
Integer
)
execution
.
getVariableLocal
(
variableName
);
}
/**
* Since no transitions are followed when leaving the inner activity,
...
...
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.java
浏览文件 @
f8046365
...
...
@@ -1060,6 +1060,28 @@ public class MultiInstanceTest extends PluggableActivitiTestCase {
assertEquals
(
0
,
runtimeService
.
createExecutionQuery
().
count
());
}
@Deployment
(
resources
=
{
"org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.testNestedMultiInstanceTasks.bpmn20.xml"
})
public
void
testNestedMultiInstanceTasks
()
{
List
<
String
>
processes
=
Arrays
.
asList
(
"process A"
,
"process B"
);
List
<
String
>
assignees
=
Arrays
.
asList
(
"kermit"
,
"gonzo"
);
Map
<
String
,
Object
>
variableMap
=
new
HashMap
<
String
,
Object
>();
variableMap
.
put
(
"subProcesses"
,
processes
);
variableMap
.
put
(
"assignees"
,
assignees
);
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"miNestedMultiInstanceTasks"
,
variableMap
);
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
list
();
assertEquals
(
processes
.
size
()
*
assignees
.
size
(),
tasks
.
size
());
for
(
Task
t
:
tasks
)
{
taskService
.
complete
(
t
.
getId
());
}
List
<
ProcessInstance
>
processInstances
=
runtimeService
.
createProcessInstanceQuery
().
processDefinitionKey
(
"miNestedMultiInstanceTasks"
).
list
();
assertEquals
(
0
,
processInstances
.
size
());
assertProcessEnded
(
processInstance
.
getId
());
}
}
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.testNestedMultiInstanceTasks.bpmn20.xml
0 → 100644
浏览文件 @
f8046365
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"Examples"
>
<process
id=
"miNestedMultiInstanceTasks"
isExecutable=
"true"
>
<startEvent
id=
"theStart"
></startEvent>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"subprocess1"
></sequenceFlow>
<sequenceFlow
id=
"flow3"
sourceRef=
"subprocess1"
targetRef=
"theEnd"
></sequenceFlow>
<endEvent
id=
"theEnd"
></endEvent>
<subProcess
id=
"subprocess1"
name=
"${subProcess}"
>
<multiInstanceLoopCharacteristics
isSequential=
"false"
activiti:collection=
"subProcesses"
activiti:elementVariable=
"subProcess"
></multiInstanceLoopCharacteristics>
<startEvent
id=
"startevent1"
name=
"Start"
></startEvent>
<endEvent
id=
"endevent1"
name=
"End"
></endEvent>
<userTask
id=
"miTasks"
name=
"My Task ${loopCounter}"
activiti:assignee=
"kermit_${loopCounter}"
>
<multiInstanceLoopCharacteristics
isSequential=
"false"
activiti:collection=
"assignees"
activiti:elementVariable=
"assignee"
></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow
id=
"flow4"
sourceRef=
"startevent1"
targetRef=
"miTasks"
></sequenceFlow>
<sequenceFlow
id=
"flow5"
sourceRef=
"miTasks"
targetRef=
"endevent1"
></sequenceFlow>
</subProcess>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_miNestedMultiInstanceTasks"
>
<bpmndi:BPMNPlane
bpmnElement=
"miNestedMultiInstanceTasks"
id=
"BPMNPlane_miNestedMultiInstanceTasks"
>
<bpmndi:BPMNShape
bpmnElement=
"miTasks"
id=
"BPMNShape_miTasks"
>
<omgdc:Bounds
height=
"60.0"
width=
"100.0"
x=
"180.0"
y=
"82.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theEnd"
id=
"BPMNShape_theEnd"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"440.0"
y=
"100.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theStart"
id=
"BPMNShape_theStart"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"-10.0"
y=
"94.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"subprocess1"
id=
"BPMNShape_subprocess1"
isExpanded=
"false"
>
<omgdc:Bounds
height=
"171.0"
width=
"291.0"
x=
"90.0"
y=
"24.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"startevent1"
id=
"BPMNShape_startevent1"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"110.0"
y=
"94.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"endevent1"
id=
"BPMNShape_endevent1"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"330.0"
y=
"94.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"381.0"
y=
"109.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"440.0"
y=
"117.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"25.0"
y=
"111.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"42.0"
y=
"107.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"90.0"
y=
"109.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow4"
id=
"BPMNEdge_flow4"
>
<omgdi:waypoint
x=
"145.0"
y=
"111.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"180.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow5"
id=
"BPMNEdge_flow5"
>
<omgdi:waypoint
x=
"280.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"330.0"
y=
"111.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录