Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
63982c60
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,发现更多精彩内容 >>
提交
63982c60
编写于
10月 10, 2017
作者:
J
Joram Barrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cmmn: add deployment id query option for tasks
上级
dc523532
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
363 addition
and
14 deletion
+363
-14
modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/persistence/entity/CaseInstanceEntityManagerImpl.java
...mpl/persistence/entity/CaseInstanceEntityManagerImpl.java
+11
-2
modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/test/FlowableCmmnTestCase.java
...a/org/flowable/cmmn/engine/test/FlowableCmmnTestCase.java
+7
-0
modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/task/CmmnTaskQueryTest.java
...t/java/org/flowable/cmmn/test/task/CmmnTaskQueryTest.java
+103
-0
modules/flowable-cmmn-engine/src/test/resources/org/flowable/cmmn/test/one-human-task-model.cmmn
...esources/org/flowable/cmmn/test/one-human-task-model.cmmn
+15
-0
modules/flowable-task-service-api/src/main/java/org/flowable/task/service/TaskInfoQuery.java
...rc/main/java/org/flowable/task/service/TaskInfoQuery.java
+10
-0
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java
...able/task/service/impl/HistoricTaskInstanceQueryImpl.java
+31
-0
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java
...in/java/org/flowable/task/service/impl/TaskQueryImpl.java
+30
-0
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskServiceImpl.java
.../java/org/flowable/task/service/impl/TaskServiceImpl.java
+1
-1
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/TaskEntityManager.java
...sk/service/impl/persistence/entity/TaskEntityManager.java
+3
-1
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/TaskEntityManagerImpl.java
...ervice/impl/persistence/entity/TaskEntityManagerImpl.java
+7
-2
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/data/TaskDataManager.java
...service/impl/persistence/entity/data/TaskDataManager.java
+3
-1
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/data/impl/MybatisTaskDataManager.java
.../persistence/entity/data/impl/MybatisTaskDataManager.java
+14
-3
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/data/impl/cachematcher/TasksByScopeIdAndScopeTypeMatcher.java
.../impl/cachematcher/TasksByScopeIdAndScopeTypeMatcher.java
+34
-0
modules/flowable-task-service/src/main/resources/org/flowable/task/db/mapping/entity/HistoricTaskInstance.xml
.../flowable/task/db/mapping/entity/HistoricTaskInstance.xml
+44
-2
modules/flowable-task-service/src/main/resources/org/flowable/task/db/mapping/entity/Task.xml
...in/resources/org/flowable/task/db/mapping/entity/Task.xml
+50
-2
未找到文件。
modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/persistence/entity/CaseInstanceEntityManagerImpl.java
浏览文件 @
63982c60
...
...
@@ -23,6 +23,8 @@ import org.flowable.cmmn.engine.runtime.CaseInstance;
import
org.flowable.cmmn.engine.runtime.CaseInstanceQuery
;
import
org.flowable.engine.common.impl.interceptor.CommandContext
;
import
org.flowable.engine.common.impl.persistence.entity.data.DataManager
;
import
org.flowable.task.service.impl.persistence.entity.TaskEntity
;
import
org.flowable.task.service.impl.persistence.entity.TaskEntityManager
;
import
org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntity
;
import
org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntityManager
;
import
org.flowable.variable.service.type.VariableScopeType
;
...
...
@@ -76,14 +78,21 @@ public class CaseInstanceEntityManagerImpl extends AbstractCmmnEntityManager<Cas
CommandContext
commandContext
=
CommandContextUtil
.
getCommandContext
();
// Variables
CommandContextUtil
.
getVariableServiceConfiguration
(
commandContext
).
getVariableInstanceEntityManager
();
VariableInstanceEntityManager
variableInstanceEntityManager
=
getVariableInstanceEntityManager
();
VariableInstanceEntityManager
variableInstanceEntityManager
=
CommandContextUtil
.
getVariableServiceConfiguration
(
commandContext
).
getVariableInstanceEntityManager
();
List
<
VariableInstanceEntity
>
variableInstanceEntities
=
variableInstanceEntityManager
.
findVariableInstanceByScopeIdAndScopeType
(
caseInstanceId
,
VariableScopeType
.
CMMN
);
for
(
VariableInstanceEntity
variableInstanceEntity
:
variableInstanceEntities
)
{
variableInstanceEntityManager
.
delete
(
variableInstanceEntity
);
}
// Tasks
TaskEntityManager
taskEntityManager
=
CommandContextUtil
.
getTaskServiceConfiguration
(
commandContext
).
getTaskEntityManager
();
List
<
TaskEntity
>
taskEntities
=
taskEntityManager
.
findTasksByScopeIdAndScopeType
(
caseInstanceId
,
VariableScopeType
.
CMMN
);
for
(
TaskEntity
taskEntity
:
taskEntities
)
{
taskEntityManager
.
delete
(
taskEntity
);
}
// Sentry part instances
List
<
SentryPartInstanceEntity
>
sentryPartInstances
=
caseInstanceEntity
.
getSatisfiedSentryPartInstances
();
for
(
SentryPartInstanceEntity
sentryPartInstanceEntity
:
sentryPartInstances
)
{
...
...
modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/test/FlowableCmmnTestCase.java
浏览文件 @
63982c60
...
...
@@ -84,6 +84,13 @@ public class FlowableCmmnTestCase {
}
}
protected
void
deployOneHumanTaskCaseModel
()
{
deploymentId
=
cmmnRepositoryService
.
createDeployment
()
.
addClasspathResource
(
"org/flowable/cmmn/test/one-human-task-model.cmmn"
)
.
deploy
()
.
getId
();
}
protected
void
deployOneTaskCaseModel
()
{
deploymentId
=
cmmnRepositoryService
.
createDeployment
()
.
addClasspathResource
(
"org/flowable/cmmn/test/one-task-model.cmmn"
)
...
...
modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/task/CmmnTaskQueryTest.java
0 → 100644
浏览文件 @
63982c60
/* 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.flowable.cmmn.test.task
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
java.util.List
;
import
org.flowable.cmmn.engine.repository.CaseDefinition
;
import
org.flowable.cmmn.engine.repository.CmmnDeployment
;
import
org.flowable.cmmn.engine.runtime.CaseInstance
;
import
org.flowable.cmmn.engine.runtime.PlanItemInstance
;
import
org.flowable.cmmn.engine.test.FlowableCmmnTestCase
;
import
org.junit.Before
;
import
org.junit.Test
;
/**
* @author Joram Barrez
*/
public
class
CmmnTaskQueryTest
extends
FlowableCmmnTestCase
{
private
static
final
int
NR_CASE_INSTANCES
=
5
;
@Before
public
void
createCaseInstance
()
{
deployOneHumanTaskCaseModel
();
for
(
int
i
=
0
;
i
<
NR_CASE_INSTANCES
;
i
++)
{
cmmnRuntimeService
.
createCaseInstanceBuilder
().
caseDefinitionKey
(
"oneTaskCase"
).
variable
(
"index"
,
i
).
start
();
}
}
@Test
public
void
testNoParams
()
{
assertEquals
(
NR_CASE_INSTANCES
,
cmmnTaskService
.
createTaskQuery
().
count
());
assertEquals
(
NR_CASE_INSTANCES
,
cmmnTaskService
.
createTaskQuery
().
list
().
size
());
}
@Test
public
void
testQueryByCaseInstanceId
()
{
List
<
CaseInstance
>
caseInstances
=
cmmnRuntimeService
.
createCaseInstanceQuery
().
list
();
assertEquals
(
5
,
caseInstances
.
size
());
for
(
CaseInstance
caseInstance
:
caseInstances
)
{
assertEquals
(
1
,
cmmnTaskService
.
createTaskQuery
().
caseInstanceId
(
caseInstance
.
getId
()).
list
().
size
());
}
}
@Test
public
void
testQueryByPlanItemInstanceId
()
{
List
<
CaseInstance
>
caseInstances
=
cmmnRuntimeService
.
createCaseInstanceQuery
().
list
();
assertEquals
(
5
,
caseInstances
.
size
());
for
(
CaseInstance
caseInstance
:
caseInstances
)
{
List
<
PlanItemInstance
>
planItemInstances
=
cmmnRuntimeService
.
createPlanItemInstanceQuery
().
planItemInstanceStateActive
().
caseInstanceId
(
caseInstance
.
getId
()).
list
();
assertEquals
(
1
,
planItemInstances
.
size
());
assertNotNull
(
cmmnTaskService
.
createTaskQuery
().
planItemInstanceId
(
planItemInstances
.
get
(
0
).
getId
()));
assertNotNull
(
cmmnTaskService
.
createTaskQuery
()
.
caseInstanceId
(
caseInstance
.
getId
())
.
planItemInstanceId
(
planItemInstances
.
get
(
0
).
getId
()));
assertNotNull
(
cmmnTaskService
.
createTaskQuery
()
.
caseInstanceId
(
caseInstance
.
getId
())
.
caseDefinitionId
(
caseInstance
.
getCaseDefinitionId
())
.
planItemInstanceId
(
planItemInstances
.
get
(
0
).
getId
()));
}
}
@Test
public
void
testQuertByCaseDefinitionId
()
{
CaseDefinition
caseDefinition
=
cmmnRepositoryService
.
createCaseDefinitionQuery
().
singleResult
();
assertNotNull
(
caseDefinition
);
assertEquals
(
NR_CASE_INSTANCES
,
cmmnTaskService
.
createTaskQuery
().
caseDefinitionId
(
caseDefinition
.
getId
()).
list
().
size
());
}
@Test
public
void
testQueryByCmmnDeploymentId
()
{
CmmnDeployment
deployment
=
cmmnRepositoryService
.
createDeploymentQuery
().
singleResult
();
assertNotNull
(
deployment
);
assertEquals
(
NR_CASE_INSTANCES
,
cmmnTaskService
.
createTaskQuery
().
cmmnDeploymentId
(
deployment
.
getId
()).
list
().
size
());
}
@Test
public
void
testQueryByAssignee
()
{
assertEquals
(
NR_CASE_INSTANCES
,
cmmnTaskService
.
createTaskQuery
().
taskAssignee
(
"johnDoe"
).
list
().
size
());
}
@Test
public
void
testQueryByVariableValueEquals
()
{
for
(
int
i
=
0
;
i
<
NR_CASE_INSTANCES
;
i
++)
{
assertNotNull
(
cmmnTaskService
.
createTaskQuery
().
taskVariableValueEquals
(
i
));
}
}
}
modules/flowable-cmmn-engine/src/test/resources/org/flowable/cmmn/test/one-human-task-model.cmmn
0 → 100644
浏览文件 @
63982c60
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/CMMN/20151109/MODEL"
xmlns:dc=
"http://www.omg.org/spec/CMMN/20151109/DC"
xmlns:di=
"http://www.omg.org/spec/CMMN/20151109/DI"
xmlns:cmmndi=
"http://www.omg.org/spec/CMMN/20151109/CMMNDI"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:flowable=
"http://flowable.org/cmmn"
targetNamespace=
"http://flowable.org/cmmn"
>
<case
id=
"oneTaskCase"
>
<casePlanModel
id=
"myPlanModel"
name=
"My CasePlanModel"
>
<planItem
id=
"planItem1"
name=
"The task"
definitionRef=
"theTask"
/>
<humanTask
id=
"theTask"
name=
"The Task"
flowable:assignee=
"johnDoe"
/>
</casePlanModel>
</case>
</definitions>
modules/flowable-task-service-api/src/main/java/org/flowable/task/service/TaskInfoQuery.java
浏览文件 @
63982c60
...
...
@@ -347,6 +347,16 @@ public interface TaskInfoQuery<T extends TaskInfoQuery<?, ?>, V extends TaskInfo
* Only select tasks which are part of a process instance which has the given deployment id.
*/
T
deploymentIdIn
(
List
<
String
>
deploymentIds
);
/**
* Only select tasks which are related to a case instance for to the given deployment id.
*/
T
cmmnDeploymentId
(
String
cmmnDeploymentId
);
/**
* Only select tasks which are related to a case instances for the given deployment id.
*/
T
cmmnDeploymentIdIn
(
List
<
String
>
cmmnDeploymentIds
);
/**
* Only select tasks which have a local task variable with the given name set to the given value.
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java
浏览文件 @
63982c60
...
...
@@ -23,6 +23,7 @@ import org.flowable.engine.common.impl.interceptor.CommandContext;
import
org.flowable.engine.common.impl.interceptor.CommandExecutor
;
import
org.flowable.idm.api.Group
;
import
org.flowable.idm.api.IdmIdentityService
;
import
org.flowable.task.service.TaskQuery
;
import
org.flowable.task.service.TaskServiceConfiguration
;
import
org.flowable.task.service.history.HistoricTaskInstance
;
import
org.flowable.task.service.history.HistoricTaskInstanceQuery
;
...
...
@@ -50,6 +51,8 @@ public class HistoricTaskInstanceQueryImpl extends AbstractVariableQueryImpl<His
protected
List
<
String
>
processCategoryNotInList
;
protected
String
deploymentId
;
protected
List
<
String
>
deploymentIds
;
protected
String
cmmnDeploymentId
;
protected
List
<
String
>
cmmnDeploymentIds
;
protected
String
processInstanceId
;
protected
List
<
String
>
processInstanceIds
;
protected
String
processInstanceBusinessKey
;
...
...
@@ -437,6 +440,26 @@ public class HistoricTaskInstanceQueryImpl extends AbstractVariableQueryImpl<His
}
return
this
;
}
@Override
public
HistoricTaskInstanceQuery
cmmnDeploymentId
(
String
cmmnDeploymentId
)
{
if
(
inOrStatement
)
{
currentOrQueryObject
.
cmmnDeploymentId
=
cmmnDeploymentId
;
}
else
{
this
.
cmmnDeploymentId
=
cmmnDeploymentId
;
}
return
this
;
}
@Override
public
HistoricTaskInstanceQuery
cmmnDeploymentIdIn
(
List
<
String
>
cmmnDeploymentIds
)
{
if
(
inOrStatement
)
{
currentOrQueryObject
.
cmmnDeploymentIds
=
cmmnDeploymentIds
;
}
else
{
this
.
cmmnDeploymentIds
=
cmmnDeploymentIds
;
}
return
this
;
}
@Override
public
HistoricTaskInstanceQuery
taskId
(
String
taskId
)
{
...
...
@@ -1536,6 +1559,14 @@ public class HistoricTaskInstanceQueryImpl extends AbstractVariableQueryImpl<His
public
List
<
String
>
getDeploymentIds
()
{
return
deploymentIds
;
}
public
String
getCmmnDeploymentId
()
{
return
cmmnDeploymentId
;
}
public
List
<
String
>
getCmmnDeploymentIds
()
{
return
cmmnDeploymentIds
;
}
public
String
getProcessInstanceBusinessKeyLike
()
{
return
processInstanceBusinessKeyLike
;
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java
浏览文件 @
63982c60
...
...
@@ -96,6 +96,8 @@ public class TaskQueryImpl extends AbstractVariableQueryImpl<TaskQuery, Task> im
protected
List
<
String
>
processCategoryNotInList
;
protected
String
deploymentId
;
protected
List
<
String
>
deploymentIds
;
protected
String
cmmnDeploymentId
;
protected
List
<
String
>
cmmnDeploymentIds
;
protected
String
processInstanceBusinessKey
;
protected
String
processInstanceBusinessKeyLike
;
protected
String
processInstanceBusinessKeyLikeIgnoreCase
;
...
...
@@ -1163,6 +1165,26 @@ public class TaskQueryImpl extends AbstractVariableQueryImpl<TaskQuery, Task> im
}
return
this
;
}
@Override
public
TaskQuery
cmmnDeploymentId
(
String
cmmnDeploymentId
)
{
if
(
orActive
)
{
currentOrQueryObject
.
cmmnDeploymentId
=
cmmnDeploymentId
;
}
else
{
this
.
cmmnDeploymentId
=
cmmnDeploymentId
;
}
return
this
;
}
@Override
public
TaskQuery
cmmnDeploymentIdIn
(
List
<
String
>
cmmnDeploymentIds
)
{
if
(
orActive
)
{
currentOrQueryObject
.
cmmnDeploymentIds
=
cmmnDeploymentIds
;
}
else
{
this
.
cmmnDeploymentIds
=
cmmnDeploymentIds
;
}
return
this
;
}
public
TaskQuery
dueDate
(
Date
dueDate
)
{
if
(
orActive
)
{
...
...
@@ -1701,6 +1723,14 @@ public class TaskQueryImpl extends AbstractVariableQueryImpl<TaskQuery, Task> im
public
List
<
String
>
getDeploymentIds
()
{
return
deploymentIds
;
}
public
String
getCmmnDeploymentId
()
{
return
cmmnDeploymentId
;
}
public
List
<
String
>
getCmmnDeploymentIds
()
{
return
cmmnDeploymentIds
;
}
public
String
getProcessInstanceBusinessKeyLike
()
{
return
processInstanceBusinessKeyLike
;
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskServiceImpl.java
浏览文件 @
63982c60
...
...
@@ -55,7 +55,7 @@ public class TaskServiceImpl extends ServiceImpl implements TaskService {
@Override
public
List
<
TaskEntity
>
findTasksBySubScopeIdScopeType
(
String
subScopeId
,
String
scopeType
)
{
return
getTaskEntityManager
().
findTasksBySubScopeIdScopeType
(
subScopeId
,
scopeType
);
return
getTaskEntityManager
().
findTasksBySubScopeId
And
ScopeType
(
subScopeId
,
scopeType
);
}
@Override
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/TaskEntityManager.java
浏览文件 @
63982c60
...
...
@@ -29,7 +29,9 @@ public interface TaskEntityManager extends EntityManager<TaskEntity> {
List
<
TaskEntity
>
findTasksByProcessInstanceId
(
String
processInstanceId
);
List
<
TaskEntity
>
findTasksBySubScopeIdScopeType
(
String
subScopeId
,
String
scopeType
);
List
<
TaskEntity
>
findTasksByScopeIdAndScopeType
(
String
scopeId
,
String
scopeType
);
List
<
TaskEntity
>
findTasksBySubScopeIdAndScopeType
(
String
subScopeId
,
String
scopeType
);
List
<
Task
>
findTasksByQueryCriteria
(
TaskQueryImpl
taskQuery
);
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/TaskEntityManagerImpl.java
浏览文件 @
63982c60
...
...
@@ -91,8 +91,13 @@ public class TaskEntityManagerImpl extends AbstractEntityManager<TaskEntity> imp
}
@Override
public
List
<
TaskEntity
>
findTasksBySubScopeIdScopeType
(
String
subScopeId
,
String
scopeType
)
{
return
taskDataManager
.
findTasksBySubScopeIdScopeType
(
subScopeId
,
scopeType
);
public
List
<
TaskEntity
>
findTasksByScopeIdAndScopeType
(
String
scopeId
,
String
scopeType
)
{
return
taskDataManager
.
findTasksByScopeIdAndScopeType
(
scopeId
,
scopeType
);
}
@Override
public
List
<
TaskEntity
>
findTasksBySubScopeIdAndScopeType
(
String
subScopeId
,
String
scopeType
)
{
return
taskDataManager
.
findTasksBySubScopeIdAndScopeType
(
subScopeId
,
scopeType
);
}
@Override
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/data/TaskDataManager.java
浏览文件 @
63982c60
...
...
@@ -29,7 +29,9 @@ public interface TaskDataManager extends DataManager<TaskEntity> {
List
<
TaskEntity
>
findTasksByProcessInstanceId
(
String
processInstanceId
);
List
<
TaskEntity
>
findTasksBySubScopeIdScopeType
(
String
subScopeId
,
String
scopeType
);
List
<
TaskEntity
>
findTasksByScopeIdAndScopeType
(
String
scopeId
,
String
scopeType
);
List
<
TaskEntity
>
findTasksBySubScopeIdAndScopeType
(
String
subScopeId
,
String
scopeType
);
List
<
Task
>
findTasksByQueryCriteria
(
TaskQueryImpl
taskQuery
);
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/data/impl/MybatisTaskDataManager.java
浏览文件 @
63982c60
...
...
@@ -25,6 +25,7 @@ import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import
org.flowable.task.service.impl.persistence.entity.TaskEntityImpl
;
import
org.flowable.task.service.impl.persistence.entity.data.TaskDataManager
;
import
org.flowable.task.service.impl.persistence.entity.data.impl.cachematcher.TasksByExecutionIdMatcher
;
import
org.flowable.task.service.impl.persistence.entity.data.impl.cachematcher.TasksByScopeIdAndScopeTypeMatcher
;
import
org.flowable.task.service.impl.persistence.entity.data.impl.cachematcher.TasksBySubScopeIdAndScopeTypeMatcher
;
import
org.flowable.task.service.impl.util.CommandContextUtil
;
...
...
@@ -35,7 +36,9 @@ public class MybatisTaskDataManager extends AbstractDataManager<TaskEntity> impl
protected
CachedEntityMatcher
<
TaskEntity
>
tasksByExecutionIdMatcher
=
new
TasksByExecutionIdMatcher
();
protected
CachedEntityMatcher
<
TaskEntity
>
tasksBySubScopeIdAndScopeType
=
new
TasksBySubScopeIdAndScopeTypeMatcher
();
protected
CachedEntityMatcher
<
TaskEntity
>
tasksBySubScopeIdAndScopeTypeMatcher
=
new
TasksBySubScopeIdAndScopeTypeMatcher
();
protected
CachedEntityMatcher
<
TaskEntity
>
tasksByScopeIdAndScopeTypeMatcher
=
new
TasksByScopeIdAndScopeTypeMatcher
();
@Override
public
Class
<?
extends
TaskEntity
>
getManagedEntityClass
()
{
...
...
@@ -59,11 +62,19 @@ public class MybatisTaskDataManager extends AbstractDataManager<TaskEntity> impl
}
@Override
public
List
<
TaskEntity
>
findTasksBySubScopeIdScopeType
(
String
subScopeId
,
String
scopeType
)
{
public
List
<
TaskEntity
>
findTasksByScopeIdAndScopeType
(
String
scopeId
,
String
scopeType
)
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"scopeId"
,
scopeId
);
params
.
put
(
"scopeType"
,
scopeType
);
return
getList
(
"selectTasksByScopeIdAndScopeType"
,
params
,
tasksByScopeIdAndScopeTypeMatcher
,
true
);
}
@Override
public
List
<
TaskEntity
>
findTasksBySubScopeIdAndScopeType
(
String
subScopeId
,
String
scopeType
)
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"subScopeId"
,
subScopeId
);
params
.
put
(
"scopeType"
,
scopeType
);
return
getList
(
"selectTasksBySubScopeIdAndScopeType"
,
params
,
tasksBySubScopeIdAndScopeType
,
true
);
return
getList
(
"selectTasksBySubScopeIdAndScopeType"
,
params
,
tasksBySubScopeIdAndScopeType
Matcher
,
true
);
}
@Override
...
...
modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/persistence/entity/data/impl/cachematcher/TasksByScopeIdAndScopeTypeMatcher.java
0 → 100644
浏览文件 @
63982c60
/* 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.flowable.task.service.impl.persistence.entity.data.impl.cachematcher
;
import
java.util.Map
;
import
org.flowable.engine.common.impl.db.CachedEntityMatcherAdapter
;
import
org.flowable.task.service.impl.persistence.entity.TaskEntity
;
/**
* @author Joram Barrez
*/
public
class
TasksByScopeIdAndScopeTypeMatcher
extends
CachedEntityMatcherAdapter
<
TaskEntity
>
{
@SuppressWarnings
(
"unchecked"
)
@Override
public
boolean
isRetained
(
TaskEntity
taskEntity
,
Object
parameter
)
{
String
scopeId
=
((
Map
<
String
,
String
>)
parameter
).
get
(
"scopeId"
);
String
scopeType
=
((
Map
<
String
,
String
>)
parameter
).
get
(
"scopeType"
);
return
taskEntity
.
getScopeId
()
!=
null
&&
taskEntity
.
getScopeId
().
equals
(
scopeId
)
&&
taskEntity
.
getScopeType
()
!=
null
&&
taskEntity
.
getScopeType
().
equals
(
scopeType
);
}
}
\ No newline at end of file
modules/flowable-task-service/src/main/resources/org/flowable/task/db/mapping/entity/HistoricTaskInstance.xml
浏览文件 @
63982c60
...
...
@@ -510,6 +510,9 @@
<if
test=
"deploymentId != null || (deploymentIds != null && deploymentIds.size() > 0)"
>
left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P ON RES.PROC_DEF_ID_ = DEPLOY_P.ID_
</if>
<if
test=
"cmmnDeploymentId != null || (cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0)"
>
left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C.ID_
</if>
<foreach
collection=
"queryVariableValues"
index=
"index"
item=
"var"
>
<choose>
<when
test=
"var.local"
>
...
...
@@ -533,6 +536,9 @@
<if
test=
"orQueryObject.deploymentId != null || (orQueryObject.deploymentIds != null && orQueryObject.deploymentIds.size() > 0)"
>
left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P_OR${orIndex} ON RES.PROC_DEF_ID_ = DEPLOY_P_OR${orIndex}.ID_
</if>
<if
test=
"orQueryObject.cmmnDeploymentId != null || (orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentId.size() > 0)"
>
left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C_OR${orIndex} ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C_OR${orIndex}.ID_
</if>
<if
test=
"orQueryObject.queryVariableValues.size() > 0"
>
<if
test=
"orQueryObject.hasLocalQueryVariableValue()"
>
left outer join ${prefix}ACT_HI_VARINST A_L_OR${orIndex} on RES.ID_ = A_L_OR${orIndex}.TASK_ID_
...
...
@@ -584,16 +590,42 @@
#{processCategory}
</foreach>
</if>
<if
test=
"deploymentId != null"
>
<if
test=
"deploymentId != null
&& cmmnDeploymentId == null
"
>
and DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId}
</if>
<if
test=
"deploymentIds != null && deploymentIds.size() > 0"
>
<if
test=
"deploymentIds != null && deploymentIds.size() > 0
&& cmmnDeploymentIds == null
"
>
and DEPLOY_P.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"deploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
</if>
<if
test=
"cmmnDeploymentId != null && deploymentId == null"
>
and DEPLOY_C.DEPLOYMENT_ID_ = #{cmmnDeploymentId}
</if>
<if
test=
"cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds == null"
>
and DEPLOY_C.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"cmmnDeploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
</if>
<if
test=
"deploymentId != null && cmmnDeploymentId != null"
>
and (DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId} or DEPLOY_C.DEPLOYMENT_ID = #{cmmnDeploymentId})
</if>
<if
test=
"cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds != null && deploymentIds.size() > 0"
>
and (
DEPLOY_P.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"deploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
or
DEPLOY_C.DEPLOYMENT_ID_ IN
<foreach
item=
"cmmnDeployment"
index=
"index"
collection=
"cmmnDeploymentIds"
open=
"("
separator=
","
close=
")"
>
#{cmmnDeployment}
</foreach>
)
</if>
<if
test=
"processInstanceId != null"
>
and RES.PROC_INST_ID_ = #{processInstanceId}
</if>
...
...
@@ -908,6 +940,16 @@
#{deployment}
</foreach>
</if>
<if
test=
"orQueryObject.cmmnDeploymentId != null"
>
or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ = #{orQueryObject.cmmnDeploymentId}
</if>
<if
test=
"orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentIds.size() > 0"
>
or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"orQueryObject.cmmnDeploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
</if>
<if
test=
"orQueryObject.processInstanceId != null"
>
or RES.PROC_INST_ID_ = #{orQueryObject.processInstanceId}
</if>
...
...
modules/flowable-task-service/src/main/resources/org/flowable/task/db/mapping/entity/Task.xml
浏览文件 @
63982c60
...
...
@@ -370,6 +370,12 @@
where T.SUB_SCOPE_ID_ = #{parameter.subScopeId, jdbcType=VARCHAR} and T.SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=VARCHAR}
</select>
<select
id=
"selectTasksByScopeIdAndScopeType"
parameterType=
"org.flowable.engine.common.impl.db.ListQueryParameterObject"
resultMap=
"taskResultMap"
>
select T.*
from ${prefix}ACT_RU_TASK T
where T.SCOPE_ID_ = #{parameter.scopeId, jdbcType=VARCHAR} and T.SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=VARCHAR}
</select>
<!-- Using distinct here because a task can appear multiple times in a resultset when -->
<select
id=
"selectTaskByQueryCriteria"
parameterType=
"org.flowable.task.service.impl.TaskQueryImpl"
resultMap=
"taskResultMap"
>
<if
test=
"firstResult != null and firstResult >= 0"
>
${limitBefore}
</if>
...
...
@@ -530,6 +536,9 @@
<if
test=
"orQueryObject.deploymentId != null || (orQueryObject.deploymentIds != null && orQueryObject.deploymentIds.size() > 0)"
>
left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P_OR${orIndex} ON RES.PROC_DEF_ID_ = DEPLOY_P_OR${orIndex}.ID_
</if>
<if
test=
"orQueryObject.cmmnDeploymentId != null || (orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentId.size() > 0)"
>
left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C_OR${orIndex} ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C_OR${orIndex}.ID_
</if>
</foreach>
<if
test=
"processDefinitionKey != null || processDefinitionKeyLike != null || processDefinitionKeyLikeIgnoreCase != null || processDefinitionName != null || processDefinitionNameLike != null || (processCategoryInList != null && processCategoryInList.size() > 0) || (processCategoryNotInList != null && processCategoryNotInList.size() > 0) || (processDefinitionKeys != null && processDefinitionKeys.size() > 0)"
>
...
...
@@ -541,6 +550,9 @@
<if
test=
"deploymentId != null || (deploymentIds != null && deploymentIds.size() > 0)"
>
left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P ON RES.PROC_DEF_ID_ = DEPLOY_P.ID_
</if>
<if
test=
"cmmnDeploymentId != null || (cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0)"
>
left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C.ID_
</if>
<where>
<if
test=
"taskId != null"
>
RES.ID_ = #{taskId}
...
...
@@ -707,16 +719,42 @@
#{processCategory}
</foreach>
</if>
<if
test=
"deploymentId != null"
>
<if
test=
"deploymentId != null
&& cmmnDeploymentId == null
"
>
and DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId}
</if>
<if
test=
"deploymentIds != null && deploymentIds.size() > 0"
>
<if
test=
"deploymentIds != null && deploymentIds.size() > 0
&& cmmnDeploymentIds == null
"
>
and DEPLOY_P.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"deploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
</if>
<if
test=
"cmmnDeploymentId != null && deploymentId == null"
>
and DEPLOY_C.DEPLOYMENT_ID_ = #{cmmnDeploymentId}
</if>
<if
test=
"cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds == null"
>
and DEPLOY_C.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"cmmnDeploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
</if>
<if
test=
"deploymentId != null && cmmnDeploymentId != null"
>
and (DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId} or DEPLOY_C.DEPLOYMENT_ID = #{cmmnDeploymentId})
</if>
<if
test=
"cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds != null && deploymentIds.size() > 0"
>
and (
DEPLOY_P.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"deploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
or
DEPLOY_C.DEPLOYMENT_ID_ IN
<foreach
item=
"cmmnDeployment"
index=
"index"
collection=
"cmmnDeploymentIds"
open=
"("
separator=
","
close=
")"
>
#{cmmnDeployment}
</foreach>
)
</if>
<if
test=
"dueDate != null"
>
and RES.DUE_DATE_ = #{dueDate}
</if>
...
...
@@ -1053,6 +1091,16 @@
#{deployment}
</foreach>
</if>
<if
test=
"orQueryObject.cmmnDeploymentId != null"
>
or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ = #{orQueryObject.cmmnDeploymentId}
</if>
<if
test=
"orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentIds.size() > 0"
>
or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ IN
<foreach
item=
"deployment"
index=
"index"
collection=
"orQueryObject.cmmnDeploymentIds"
open=
"("
separator=
","
close=
")"
>
#{deployment}
</foreach>
</if>
<if
test=
"orQueryObject.dueDate != null"
>
or RES.DUE_DATE_ = #{orQueryObject.dueDate}
</if>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录