Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
e34a9229
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,发现更多精彩内容 >>
提交
e34a9229
编写于
3月 18, 2014
作者:
F
fheremans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-1949: Intermediate catching timer event should not repeat cycle
上级
da1ee027
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
76 addition
and
2 deletion
+76
-2
modules/activiti-engine/src/main/java/org/activiti/engine/impl/jobexecutor/TimerDeclarationImpl.java
...ctiviti/engine/impl/jobexecutor/TimerDeclarationImpl.java
+9
-2
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/timer/IntermediateTimerEventTest.java
...ine/test/bpmn/event/timer/IntermediateTimerEventTest.java
+13
-0
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/event/timer/IntermediateTimerEventTest.testLoopWithCycle.bpmn20.xml
...r/IntermediateTimerEventTest.testLoopWithCycle.bpmn20.xml
+54
-0
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/impl/jobexecutor/TimerDeclarationImpl.java
浏览文件 @
e34a9229
...
...
@@ -147,8 +147,15 @@ public class TimerDeclarationImpl implements Serializable {
if
(
type
==
TimerDeclarationType
.
CYCLE
)
{
// See ACT-1427: A boundary timer with a cancelActivity='true', doesn't need to repeat itself
if
(!
isInterruptingTimer
)
{
// See ACT-1427: A boundary timer with a cancelActivity='true', doesn't need to repeat itself
boolean
repeat
=
!
isInterruptingTimer
;
// ACT-1951: intermediate catching timer events shouldn't repeat accoring to spec
if
(
TimerCatchIntermediateEventJobHandler
.
TYPE
.
equals
(
jobHandlerType
))
{
repeat
=
false
;
}
if
(
repeat
)
{
String
prepared
=
prepareRepeat
(
dueDateString
);
timer
.
setRepeat
(
prepared
);
}
...
...
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/timer/IntermediateTimerEventTest.java
浏览文件 @
e34a9229
...
...
@@ -89,5 +89,18 @@ public class IntermediateTimerEventTest extends PluggableActivitiTestCase {
assertProcessEnded
(
processInstance
.
getId
());
}
@Deployment
public
void
testLoopWithCycle
()
{
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testLoop"
);
// After looping 3 times, the process should end. Cycle should NOT repeat itself
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
Job
timer
=
managementService
.
createJobQuery
().
singleResult
();
managementService
.
executeJob
(
timer
.
getId
());
}
assertProcessEnded
(
processInstance
.
getId
());
}
}
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/event/timer/IntermediateTimerEventTest.testLoopWithCycle.bpmn20.xml
0 → 100644
浏览文件 @
e34a9229
<?xml version="1.0" encoding="UTF-8"?>
<definitions
id=
"definitions"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
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"
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
targetNamespace=
"Examples"
>
<process
id=
"testLoop"
>
<startEvent
id=
"theStart"
/>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"timer"
/>
<intermediateCatchEvent
id=
"timer"
>
<timerEventDefinition>
<timeCycle>
R3/P1D
</timeCycle>
</timerEventDefinition>
</intermediateCatchEvent>
<sequenceFlow
id=
"flow2"
sourceRef=
"timer"
targetRef=
"checkCompletion"
/>
<scriptTask
id=
"checkCompletion"
scriptFormat=
"javascript"
>
<script>
<![CDATA[
var counter = execution.getVariable('counter');
if (!counter) {
counter = 0;
}
var newCounter = counter + 1;
execution.setVariable('counter', newCounter);
if (newCounter == 3) {
execution.setVariable('completed', true);
} else {
execution.setVariable('completed', false);
}
]]>
</script>
</scriptTask>
<sequenceFlow
id=
"flowToGW"
sourceRef=
"checkCompletion"
targetRef=
"exclusivegateway"
/>
<exclusiveGateway
id=
"exclusivegateway"
name=
"Exclusive Gateway"
default=
"flow4"
></exclusiveGateway>
<sequenceFlow
id=
"flow3"
sourceRef=
"exclusivegateway"
targetRef=
"theEnd"
>
<conditionExpression
xsi:type=
"tFormalExpression"
>
${completed}
</conditionExpression>
</sequenceFlow>
<sequenceFlow
id=
"flow4"
sourceRef=
"exclusivegateway"
targetRef=
"timer"
>
</sequenceFlow>
<endEvent
id=
"theEnd"
/>
</process>
</definitions>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录