Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
f4651d3e
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,发现更多精彩内容 >>
提交
f4651d3e
编写于
1月 11, 2013
作者:
T
tijsrademakers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix for ACT-1054
上级
75a0ad7e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
163 addition
and
1 deletion
+163
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntity.java
...iviti/engine/impl/persistence/entity/ExecutionEntity.java
+13
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/VariableInstanceEntity.java
...ngine/impl/persistence/entity/VariableInstanceEntity.java
+6
-0
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/VariableInstance.xml
...urces/org/activiti/db/mapping/entity/VariableInstance.xml
+1
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/usertask/UserTaskTest.java
.../org/activiti/engine/test/bpmn/usertask/UserTaskTest.java
+19
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/usertask/UserTaskTestCreateTaskListener.java
...ne/test/bpmn/usertask/UserTaskTestCreateTaskListener.java
+54
-0
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/usertask/UserTaskTest.testCompleteAfterParallelGateway.bpmn20.xml
.../UserTaskTest.testCompleteAfterParallelGateway.bpmn20.xml
+70
-0
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntity.java
浏览文件 @
f4651d3e
...
...
@@ -59,7 +59,9 @@ import org.slf4j.LoggerFactory;
* @author Tom Baeyens
* @author Daniel Meyer
* @author Falko Menge
* @author Saeid Mirzaei
*/
public
class
ExecutionEntity
extends
VariableScopeImpl
implements
ActivityExecution
,
ExecutionListenerExecution
,
Execution
,
PvmExecution
,
ProcessInstance
,
InterpretableExecution
,
PersistentObject
,
HasRevision
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -929,7 +931,17 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
// update the related tasks
for
(
TaskEntity
task:
getTasks
())
{
task
.
setExecutionId
(
replacedBy
.
getId
());
task
.
setExecution
(
this
.
replacedBy
);
task
.
setExecution
(
this
.
replacedBy
);
// update the related local task variables
List
<
VariableInstanceEntity
>
variables
=
(
List
)
commandContext
.
getVariableInstanceEntityManager
()
.
findVariableInstancesByTaskId
(
task
.
getId
());
for
(
VariableInstanceEntity
variable
:
variables
)
{
variable
.
setExecution
(
this
.
replacedBy
);
}
this
.
replacedBy
.
addTask
(
task
);
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/VariableInstanceEntity.java
浏览文件 @
f4651d3e
...
...
@@ -50,6 +50,8 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Ha
protected
VariableType
type
;
boolean
forcedUpdate
;
// Default constructor for SQL mapping
protected
VariableInstanceEntity
()
{
}
...
...
@@ -77,6 +79,7 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Ha
public
void
setExecution
(
ExecutionEntity
execution
)
{
this
.
executionId
=
execution
.
getId
();
this
.
processInstanceId
=
execution
.
getProcessInstanceId
();
forcedUpdate
=
true
;
}
public
void
delete
()
{
...
...
@@ -103,6 +106,9 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Ha
if
(
byteArrayValueId
!=
null
)
{
persistentState
.
put
(
"byteArrayValueId"
,
byteArrayValueId
);
}
if
(
forcedUpdate
)
{
persistentState
.
put
(
"forcedUpdate"
,
Boolean
.
TRUE
);
}
return
persistentState
;
}
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/VariableInstance.xml
浏览文件 @
f4651d3e
...
...
@@ -30,6 +30,7 @@
update ${prefix}ACT_RU_VARIABLE
set
REV_ = #{revisionNext, jdbcType=INTEGER},
EXECUTION_ID_ = #{executionId, jdbcType=VARCHAR},
BYTEARRAY_ID_ = #{byteArrayValueId, jdbcType=VARCHAR},
DOUBLE_ = #{doubleValue, jdbcType=DOUBLE},
LONG_ = #{longValue, jdbcType=BIGINT},
...
...
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/usertask/UserTaskTest.java
浏览文件 @
f4651d3e
...
...
@@ -13,6 +13,8 @@
package
org.activiti.engine.test.bpmn.usertask
;
import
java.util.List
;
import
org.activiti.engine.impl.history.HistoryLevel
;
import
org.activiti.engine.impl.test.PluggableActivitiTestCase
;
import
org.activiti.engine.runtime.ProcessInstance
;
...
...
@@ -53,4 +55,21 @@ public class UserTaskTest extends PluggableActivitiTestCase {
assertEquals
(
1
,
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
list
().
size
());
}
@Deployment
public
void
testCompleteAfterParallelGateway
()
throws
InterruptedException
{
// related to http://jira.codehaus.org/browse/ACT-1054
// start the process
runtimeService
.
startProcessInstanceByKey
(
"ForkProcess"
);
List
<
Task
>
taskList
=
taskService
.
createTaskQuery
().
list
();
assertNotNull
(
taskList
);
assertEquals
(
2
,
taskList
.
size
());
// make sure user task exists
Task
task
=
taskService
.
createTaskQuery
().
taskDefinitionKey
(
"SimpleUser"
).
singleResult
();
assertNotNull
(
task
);
// attempt to complete the task and get PersistenceException pointing to "referential integrity constraint violation"
taskService
.
complete
(
task
.
getId
());
}
}
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/usertask/UserTaskTestCreateTaskListener.java
0 → 100755
浏览文件 @
f4651d3e
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.engine.test.bpmn.usertask
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.activiti.engine.delegate.TaskListener
;
import
org.activiti.engine.impl.el.Expression
;
/**
* @author Tom Baeyens
* @author Daniel Meyer
* @author Falko Menge
* @author Saeid Mirzaei
*/
/**
* This is for test case UserTaskTest.testCompleteAfterParallelGateway
*
*/
public
class
UserTaskTestCreateTaskListener
implements
TaskListener
{
private
static
final
long
serialVersionUID
=
1L
;
private
Expression
expression
;
@Override
public
void
notify
(
DelegateTask
delegateTask
)
{
if
(
this
.
expression
!=
null
&&
this
.
expression
.
getValue
(
delegateTask
)
!=
null
)
{
// get the expression variable
String
expression
=
this
.
expression
.
getValue
(
delegateTask
).
toString
();
// this expression will be evaluated when completing the task
delegateTask
.
setVariableLocal
(
"validationRule"
,
expression
);
}
}
}
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/usertask/UserTaskTest.testCompleteAfterParallelGateway.bpmn20.xml
0 → 100644
浏览文件 @
f4651d3e
<?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=
"http://activiti.org/bpmn20"
>
<process
id=
"ForkProcess"
name=
"Fork Process"
>
<startEvent
id=
"theStart"
name=
"Start"
></startEvent>
<sequenceFlow
id=
"flow1"
name=
""
sourceRef=
"theStart"
targetRef=
"initialFork"
></sequenceFlow>
<parallelGateway
id=
"initialFork"
name=
"Parallel Gateway"
></parallelGateway>
<sequenceFlow
id=
"flow2"
name=
""
sourceRef=
"initialFork"
targetRef=
"SimpleUser"
></sequenceFlow>
<sequenceFlow
id=
"flow3"
name=
""
sourceRef=
"initialFork"
targetRef=
"UserwithListener"
></sequenceFlow>
<userTask
id=
"SimpleUser"
name=
"Simple User"
></userTask>
<userTask
id=
"UserwithListener"
name=
"User with Listener"
>
<extensionElements>
<activiti:taskListener
event=
'create'
class=
'org.activiti.engine.test.bpmn.usertask.UserTaskTestCreateTaskListener'
>
<activiti:field
name=
'expression'
stringValue=
'some expression value'
/>
</activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow
id=
"flow4"
name=
""
sourceRef=
"UserwithListener"
targetRef=
"endevent2"
></sequenceFlow>
<sequenceFlow
id=
"flow5"
name=
""
sourceRef=
"SimpleUser"
targetRef=
"theEvent1"
></sequenceFlow>
<endEvent
id=
"theEvent1"
name=
"End1"
></endEvent>
<endEvent
id=
"endevent2"
name=
"End2"
></endEvent>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_ForkProcess"
>
<bpmndi:BPMNPlane
bpmnElement=
"ForkProcess"
id=
"BPMNPlane_ForkProcess"
>
<bpmndi:BPMNShape
bpmnElement=
"theStart"
id=
"BPMNShape_theStart"
>
<omgdc:Bounds
height=
"35"
width=
"35"
x=
"50"
y=
"163"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theEvent1"
id=
"BPMNShape_theEvent1"
>
<omgdc:Bounds
height=
"35"
width=
"35"
x=
"650"
y=
"120"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"initialFork"
id=
"BPMNShape_initialFork"
>
<omgdc:Bounds
height=
"40"
width=
"40"
x=
"160"
y=
"160"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"SimpleUser"
id=
"BPMNShape_SimpleUser"
>
<omgdc:Bounds
height=
"55"
width=
"105"
x=
"370"
y=
"110"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"UserwithListener"
id=
"BPMNShape_UserwithListener"
>
<omgdc:Bounds
height=
"55"
width=
"105"
x=
"370"
y=
"250"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"endevent2"
id=
"BPMNShape_endevent2"
>
<omgdc:Bounds
height=
"35"
width=
"35"
x=
"650"
y=
"260"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"85"
y=
"180"
></omgdi:waypoint>
<omgdi:waypoint
x=
"160"
y=
"180"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow2"
id=
"BPMNEdge_flow2"
>
<omgdi:waypoint
x=
"180"
y=
"160"
></omgdi:waypoint>
<omgdi:waypoint
x=
"180"
y=
"137"
></omgdi:waypoint>
<omgdi:waypoint
x=
"370"
y=
"137"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"180"
y=
"200"
></omgdi:waypoint>
<omgdi:waypoint
x=
"180"
y=
"277"
></omgdi:waypoint>
<omgdi:waypoint
x=
"370"
y=
"277"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow4"
id=
"BPMNEdge_flow4"
>
<omgdi:waypoint
x=
"475"
y=
"277"
></omgdi:waypoint>
<omgdi:waypoint
x=
"650"
y=
"277"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow5"
id=
"BPMNEdge_flow5"
>
<omgdi:waypoint
x=
"475"
y=
"137"
></omgdi:waypoint>
<omgdi:waypoint
x=
"650"
y=
"137"
></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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录