Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
5f8c72ef
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,发现更多精彩内容 >>
提交
5f8c72ef
编写于
10月 03, 2017
作者:
J
Joram Barrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #587 : event subscriptions should only be deleted when sibling executions are not active
上级
adca1a37
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
47 addition
and
38 deletion
+47
-38
modules/flowable-engine/src/main/java/org/flowable/engine/impl/agenda/EndExecutionOperation.java
...rg/flowable/engine/impl/agenda/EndExecutionOperation.java
+39
-9
modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/entity/ExecutionEntity.java
...wable/engine/impl/persistence/entity/ExecutionEntity.java
+0
-21
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/message/MessageEventSubprocessTest.testNonInterruptingMultipleInstances.bpmn20.xml
...ocessTest.testNonInterruptingMultipleInstances.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/message/MessageEventSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
...ntSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/message/MessageEventSubprocessTest.testNonInterruptingUnderProcessDefinition.bpmn20.xml
...Test.testNonInterruptingUnderProcessDefinition.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/signal/SignalEventSubprocessTest.testNonInterruptingMultipleInstances.bpmn20.xml
...ocessTest.testNonInterruptingMultipleInstances.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/signal/SignalEventSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
...ntSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/signal/SignalEventSubprocessTest.testNonInterruptingUnderProcessDefinition.bpmn20.xml
...Test.testNonInterruptingUnderProcessDefinition.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/timer/TimerEventSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
...ntSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
+1
-1
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/timer/TimerEventSubprocessTest.testNonInterruptingUnderProcessDefinition.bpmn20.xml
...Test.testNonInterruptingUnderProcessDefinition.bpmn20.xml
+1
-1
未找到文件。
modules/flowable-engine/src/main/java/org/flowable/engine/impl/agenda/EndExecutionOperation.java
浏览文件 @
5f8c72ef
...
...
@@ -196,8 +196,28 @@ public class EndExecutionOperation extends AbstractOperation {
// If there are no more active child executions, the process can be continued
// If not (eg an embedded subprocess still has active elements, we cannot continue)
if
(
getNumberOfActiveChildExecutionsForExecution
(
executionEntityManager
,
parentExecution
.
getId
())
==
0
||
isAllEventScopeExecutions
(
executionEntityManager
,
parentExecution
))
{
List
<
ExecutionEntity
>
eventScopeExecutions
=
getEventScopeExecutions
(
executionEntityManager
,
parentExecution
);
// Event scoped executions need to be deleted when there are no active siblings anymore,
// unless instances of the event subprocess itself. If there are no active siblings anymore,
// the current scope had ended and the event subprocess start event should stop listening to any trigger.
if
(!
eventScopeExecutions
.
isEmpty
())
{
List
<?
extends
ExecutionEntity
>
childExecutions
=
parentExecution
.
getExecutions
();
boolean
activeSiblings
=
false
;
for
(
ExecutionEntity
childExecutionEntity
:
childExecutions
)
{
if
(!
isInEventSubProcess
(
childExecutionEntity
)
&&
childExecutionEntity
.
isActive
()
&&
!
childExecutionEntity
.
isEnded
())
{
activeSiblings
=
true
;
}
}
if
(!
activeSiblings
)
{
for
(
ExecutionEntity
eventScopeExecution
:
eventScopeExecutions
)
{
executionEntityManager
.
deleteExecutionAndRelatedData
(
eventScopeExecution
,
null
);
}
}
}
if
(
getNumberOfActiveChildExecutionsForExecution
(
executionEntityManager
,
parentExecution
.
getId
())
==
0
)
{
ExecutionEntity
executionToContinue
=
null
;
...
...
@@ -386,18 +406,16 @@ public class EndExecutionOperation extends AbstractOperation {
return
activeChildExecutions
;
}
protected
boolean
isAll
EventScopeExecutions
(
ExecutionEntityManager
executionEntityManager
,
ExecutionEntity
parentExecution
)
{
boolean
allEventScopeExecutions
=
true
;
protected
List
<
ExecutionEntity
>
get
EventScopeExecutions
(
ExecutionEntityManager
executionEntityManager
,
ExecutionEntity
parentExecution
)
{
List
<
ExecutionEntity
>
eventScopeExecutions
=
new
ArrayList
<>(
1
)
;
List
<
ExecutionEntity
>
executions
=
executionEntityManager
.
findChildExecutionsByParentExecutionId
(
parentExecution
.
getId
());
for
(
ExecutionEntity
childExecution
:
executions
)
{
if
(
childExecution
.
isEventScope
())
{
e
xecutionEntityManager
.
deleteExecutionAndRelatedData
(
childExecution
,
null
);
e
ventScopeExecutions
.
add
(
childExecution
);
}
else
{
allEventScopeExecutions
=
false
;
}
}
}
return
allE
ventScopeExecutions
;
return
e
ventScopeExecutions
;
}
protected
boolean
allChildExecutionsEnded
(
ExecutionEntity
parentExecutionEntity
,
ExecutionEntity
executionEntityToIgnore
)
{
...
...
@@ -415,4 +433,16 @@ public class EndExecutionOperation extends AbstractOperation {
}
return
true
;
}
protected
boolean
isInEventSubProcess
(
ExecutionEntity
executionEntity
)
{
ExecutionEntity
currentExecutionEntity
=
executionEntity
;
while
(
currentExecutionEntity
!=
null
)
{
if
(
currentExecutionEntity
.
getCurrentFlowElement
()
instanceof
EventSubProcess
)
{
return
true
;
}
currentExecutionEntity
=
currentExecutionEntity
.
getParent
();
}
return
false
;
}
}
modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/entity/ExecutionEntity.java
浏览文件 @
5f8c72ef
...
...
@@ -93,9 +93,6 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
void
setEnded
(
boolean
isEnded
);
@Override
void
setEventName
(
String
eventName
);
String
getDeleteReason
();
void
setDeleteReason
(
String
deleteReason
);
...
...
@@ -108,12 +105,6 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
void
setEventScope
(
boolean
isEventScope
);
@Override
boolean
isMultiInstanceRoot
();
@Override
void
setMultiInstanceRoot
(
boolean
isMultiInstanceRoot
);
void
setName
(
String
name
);
void
setDescription
(
String
description
);
...
...
@@ -128,26 +119,14 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
void
setLockTime
(
Date
lockTime
);
@Override
boolean
isDeleted
();
@Override
void
setDeleted
(
boolean
isDeleted
);
void
forceUpdate
();
String
getStartActivityId
();
void
setStartActivityId
(
String
startActivityId
);
@Override
String
getStartUserId
();
void
setStartUserId
(
String
startUserId
);
@Override
Date
getStartTime
();
void
setStartTime
(
Date
startTime
);
void
setCallbackId
(
String
callbackId
);
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/message/MessageEventSubprocessTest.testNonInterruptingMultipleInstances.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -13,7 +13,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<messageEventDefinition
messageRef=
"messageId"
/>
</startEvent>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/message/MessageEventSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -13,7 +13,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<messageEventDefinition
messageRef=
"messageId"
/>
</startEvent>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/message/MessageEventSubprocessTest.testNonInterruptingUnderProcessDefinition.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -13,7 +13,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<messageEventDefinition
messageRef=
"messageId"
/>
</startEvent>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/signal/SignalEventSubprocessTest.testNonInterruptingMultipleInstances.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -13,7 +13,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<signalEventDefinition
signalRef=
"signalId"
/>
</startEvent>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/signal/SignalEventSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -13,7 +13,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<signalEventDefinition
signalRef=
"signalId"
/>
</startEvent>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/signal/SignalEventSubprocessTest.testNonInterruptingUnderProcessDefinition.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -13,7 +13,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<signalEventDefinition
signalRef=
"signalId"
/>
</startEvent>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/timer/TimerEventSubprocessTest.testNonInterruptingSubProcess.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -11,7 +11,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<timerEventDefinition>
<timeCycle>
R3/P1D
</timeCycle>
...
...
modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/timer/TimerEventSubprocessTest.testNonInterruptingUnderProcessDefinition.bpmn20.xml
浏览文件 @
5f8c72ef
...
...
@@ -11,7 +11,7 @@
<sequenceFlow
sourceRef=
"task"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
<subProcess
triggeredByEvent=
"true"
>
<subProcess
id=
"eventSubProcess"
triggeredByEvent=
"true"
>
<startEvent
id=
"eventProcessStart"
isInterrupting=
"false"
>
<timerEventDefinition>
<timeDuration>
P1D
</timeDuration>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录