Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
3e28c07e
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,发现更多精彩内容 >>
提交
3e28c07e
编写于
11月 06, 2013
作者:
J
Joram Barrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-1840: Allow to set a 'category' on tasks
上级
c8c5e52d
变更
48
隐藏空白更改
内联
并排
Showing
48 changed file
with
266 addition
and
16 deletion
+266
-16
modules/activiti-bpmn-converter/src/main/java/org/activiti/bpmn/constants/BpmnXMLConstants.java
...in/java/org/activiti/bpmn/constants/BpmnXMLConstants.java
+1
-0
modules/activiti-bpmn-converter/src/main/java/org/activiti/bpmn/converter/UserTaskXMLConverter.java
...ava/org/activiti/bpmn/converter/UserTaskXMLConverter.java
+2
-0
modules/activiti-bpmn-model/src/main/java/org/activiti/bpmn/model/UserTask.java
...model/src/main/java/org/activiti/bpmn/model/UserTask.java
+10
-1
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricTaskInstance.java
...ava/org/activiti/engine/history/HistoricTaskInstance.java
+5
-2
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricTaskInstanceQuery.java
...rg/activiti/engine/history/HistoricTaskInstanceQuery.java
+5
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java
...g/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java
+6
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java
...src/main/java/org/activiti/engine/impl/TaskQueryImpl.java
+6
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/UserTaskActivityBehavior.java
...i/engine/impl/bpmn/behavior/UserTaskActivityBehavior.java
+12
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/UserTaskParseHandler.java
...engine/impl/bpmn/parser/handler/UserTaskParseHandler.java
+5
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/history/HistoryManager.java
...java/org/activiti/engine/impl/history/HistoryManager.java
+13
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricTaskInstanceEntity.java
...e/impl/persistence/entity/HistoricTaskInstanceEntity.java
+8
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/TaskEntity.java
...g/activiti/engine/impl/persistence/entity/TaskEntity.java
+17
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/task/TaskDefinition.java
...in/java/org/activiti/engine/impl/task/TaskDefinition.java
+10
-1
modules/activiti-engine/src/main/java/org/activiti/engine/task/Task.java
...i-engine/src/main/java/org/activiti/engine/task/Task.java
+6
-0
modules/activiti-engine/src/main/java/org/activiti/engine/task/TaskQuery.java
...ine/src/main/java/org/activiti/engine/task/TaskQuery.java
+7
-4
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.engine.sql
...ces/org/activiti/db/create/activiti.db2.create.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.history.sql
...es/org/activiti/db/create/activiti.db2.create.history.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.h2.create.engine.sql
...rces/org/activiti/db/create/activiti.h2.create.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.h2.create.history.sql
...ces/org/activiti/db/create/activiti.h2.create.history.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mssql.create.engine.sql
...s/org/activiti/db/create/activiti.mssql.create.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mssql.create.history.sql
.../org/activiti/db/create/activiti.mssql.create.history.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mysql.create.engine.sql
...s/org/activiti/db/create/activiti.mysql.create.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mysql.create.history.sql
.../org/activiti/db/create/activiti.mysql.create.history.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.oracle.create.engine.sql
.../org/activiti/db/create/activiti.oracle.create.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.oracle.create.history.sql
...org/activiti/db/create/activiti.oracle.create.history.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.postgres.create.engine.sql
...rg/activiti/db/create/activiti.postgres.create.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.postgres.create.history.sql
...g/activiti/db/create/activiti.postgres.create.history.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricTaskInstance.xml
...s/org/activiti/db/mapping/entity/HistoricTaskInstance.xml
+11
-3
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Task.xml
...rc/main/resources/org/activiti/db/mapping/entity/Task.xml
+23
-1
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.db2.upgradestep.514.to.515.engine.sql
...db/upgrade/activiti.db2.upgradestep.514.to.515.engine.sql
+4
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.db2.upgradestep.514.to.515.history.sql
...b/upgrade/activiti.db2.upgradestep.514.to.515.history.sql
+2
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.h2.upgradestep.514.to.515.engine.sql
.../db/upgrade/activiti.h2.upgradestep.514.to.515.engine.sql
+4
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.h2.upgradestep.514.to.515.history.sql
...db/upgrade/activiti.h2.upgradestep.514.to.515.history.sql
+2
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mssql.upgradestep.514.to.515.engine.sql
.../upgrade/activiti.mssql.upgradestep.514.to.515.engine.sql
+4
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mssql.upgradestep.514.to.515.history.sql
...upgrade/activiti.mssql.upgradestep.514.to.515.history.sql
+2
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mysql.upgradestep.514.to.515.engine.sql
.../upgrade/activiti.mysql.upgradestep.514.to.515.engine.sql
+4
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mysql.upgradestep.514.to.515.history.sql
...upgrade/activiti.mysql.upgradestep.514.to.515.history.sql
+2
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.oracle.upgradestep.514.to.515.engine.sql
...upgrade/activiti.oracle.upgradestep.514.to.515.engine.sql
+4
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.oracle.upgradestep.514.to.515.history.sql
...pgrade/activiti.oracle.upgradestep.514.to.515.history.sql
+2
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.postgres.upgradestep.514.to.515.engine.sql
...grade/activiti.postgres.upgradestep.514.to.515.engine.sql
+4
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.postgres.upgradestep.514.to.515.history.sql
...rade/activiti.postgres.upgradestep.514.to.515.history.sql
+2
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/usertask/UserTaskTest.java
.../org/activiti/engine/test/bpmn/usertask/UserTaskTest.java
+39
-0
modules/activiti-engine/src/test/java/org/activiti/examples/mgmt/ManagementServiceTest.java
...ava/org/activiti/examples/mgmt/ManagementServiceTest.java
+1
-1
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/usertask/UserTaskTest.testTaskCategory.bpmn20.xml
...st/bpmn/usertask/UserTaskTest.testTaskCategory.bpmn20.xml
+17
-0
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/task/data/HistoricTaskWrapper.java
...g/activiti/explorer/ui/task/data/HistoricTaskWrapper.java
+10
-1
modules/activiti-json-converter/src/main/java/org/activiti/editor/constants/StencilConstants.java
.../java/org/activiti/editor/constants/StencilConstants.java
+1
-0
modules/activiti-json-converter/src/main/java/org/activiti/editor/language/json/converter/UserTaskJsonConverter.java
...editor/language/json/converter/UserTaskJsonConverter.java
+2
-0
pom.xml
pom.xml
+1
-0
未找到文件。
modules/activiti-bpmn-converter/src/main/java/org/activiti/bpmn/constants/BpmnXMLConstants.java
浏览文件 @
3e28c07e
...
...
@@ -154,6 +154,7 @@ public interface BpmnXMLConstants {
public
static
final
String
ATTRIBUTE_TASK_USER_CANDIDATEUSERS
=
"candidateUsers"
;
public
static
final
String
ATTRIBUTE_TASK_USER_CANDIDATEGROUPS
=
"candidateGroups"
;
public
static
final
String
ATTRIBUTE_TASK_USER_DUEDATE
=
"dueDate"
;
public
static
final
String
ATTRIBUTE_TASK_USER_CATEGORY
=
"category"
;
public
static
final
String
ATTRIBUTE_TASK_USER_PRIORITY
=
"priority"
;
public
static
final
String
ATTRIBUTE_TASK_RULE_VARIABLES_INPUT
=
"ruleVariablesInput"
;
...
...
modules/activiti-bpmn-converter/src/main/java/org/activiti/bpmn/converter/UserTaskXMLConverter.java
浏览文件 @
3e28c07e
...
...
@@ -85,6 +85,7 @@ public class UserTaskXMLConverter extends BaseBpmnXMLConverter {
}
BpmnXMLUtil
.
addXMLLocation
(
userTask
,
xtr
);
userTask
.
setDueDate
(
xtr
.
getAttributeValue
(
ACTIVITI_EXTENSIONS_NAMESPACE
,
ATTRIBUTE_TASK_USER_DUEDATE
));
userTask
.
setCategory
(
xtr
.
getAttributeValue
(
ACTIVITI_EXTENSIONS_NAMESPACE
,
ATTRIBUTE_TASK_USER_CATEGORY
));
userTask
.
setFormKey
(
formKey
);
userTask
.
setAssignee
(
xtr
.
getAttributeValue
(
ACTIVITI_EXTENSIONS_NAMESPACE
,
ATTRIBUTE_TASK_USER_ASSIGNEE
));
userTask
.
setOwner
(
xtr
.
getAttributeValue
(
ACTIVITI_EXTENSIONS_NAMESPACE
,
ATTRIBUTE_TASK_USER_OWNER
));
...
...
@@ -115,6 +116,7 @@ public class UserTaskXMLConverter extends BaseBpmnXMLConverter {
writeQualifiedAttribute
(
ATTRIBUTE_TASK_USER_CANDIDATEUSERS
,
convertToDelimitedString
(
userTask
.
getCandidateUsers
()),
xtw
);
writeQualifiedAttribute
(
ATTRIBUTE_TASK_USER_CANDIDATEGROUPS
,
convertToDelimitedString
(
userTask
.
getCandidateGroups
()),
xtw
);
writeQualifiedAttribute
(
ATTRIBUTE_TASK_USER_DUEDATE
,
userTask
.
getDueDate
(),
xtw
);
writeQualifiedAttribute
(
ATTRIBUTE_TASK_USER_CATEGORY
,
userTask
.
getCategory
(),
xtw
);
writeQualifiedAttribute
(
ATTRIBUTE_FORM_FORMKEY
,
userTask
.
getFormKey
(),
xtw
);
if
(
userTask
.
getPriority
()
!=
null
)
{
writeQualifiedAttribute
(
ATTRIBUTE_TASK_USER_PRIORITY
,
userTask
.
getPriority
().
toString
(),
xtw
);
...
...
modules/activiti-bpmn-model/src/main/java/org/activiti/bpmn/model/UserTask.java
浏览文件 @
3e28c07e
...
...
@@ -25,6 +25,7 @@ public class UserTask extends Task {
protected
String
priority
;
protected
String
formKey
;
protected
String
dueDate
;
protected
String
category
;
protected
List
<
String
>
candidateUsers
=
new
ArrayList
<
String
>();
protected
List
<
String
>
candidateGroups
=
new
ArrayList
<
String
>();
protected
List
<
FormProperty
>
formProperties
=
new
ArrayList
<
FormProperty
>();
...
...
@@ -60,7 +61,13 @@ public class UserTask extends Task {
public
void
setDueDate
(
String
dueDate
)
{
this
.
dueDate
=
dueDate
;
}
public
List
<
String
>
getCandidateUsers
()
{
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
List
<
String
>
getCandidateUsers
()
{
return
candidateUsers
;
}
public
void
setCandidateUsers
(
List
<
String
>
candidateUsers
)
{
...
...
@@ -99,6 +106,8 @@ public class UserTask extends Task {
setCandidateUsers
(
new
ArrayList
<
String
>(
otherElement
.
getCandidateUsers
()));
setDocumentation
(
otherElement
.
getDocumentation
());
setFormKey
(
otherElement
.
getFormKey
());
setDueDate
(
otherElement
.
getDueDate
());
setCategory
(
otherElement
.
getCategory
());
taskListeners
=
new
ArrayList
<
ActivitiListener
>();
if
(
otherElement
.
getTaskListeners
()
!=
null
&&
otherElement
.
getTaskListeners
().
size
()
>
0
)
{
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricTaskInstance.java
浏览文件 @
3e28c07e
...
...
@@ -76,12 +76,15 @@ public interface HistoricTaskInstance {
/** Task form key. */
String
getFormKey
();
/** Task priority *
*
/
/** Task priority */
int
getPriority
();
/** Task due date *
*
/
/** Task due date */
Date
getDueDate
();
/** Task category */
String
getCategory
();
/** The parent task of this task, in case this task was a subtask */
String
getParentTaskId
();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricTaskInstanceQuery.java
浏览文件 @
3e28c07e
...
...
@@ -251,6 +251,11 @@ public interface HistoricTaskInstanceQuery extends Query<HistoricTaskInstanceQu
*/
HistoricTaskInstanceQuery
taskCompletedAfter
(
Date
endDate
);
/**
* Only select tasks with the given category. This is an optional field and allows to 'tag' tasks as belonging to a certain category.
*/
HistoricTaskInstanceQuery
taskCategory
(
String
category
);
/**
* Only select tasks which have a local task variable with the given name
* set to the given value.
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java
浏览文件 @
3e28c07e
...
...
@@ -77,6 +77,7 @@ public class HistoricTaskInstanceQueryImpl extends AbstractVariableQueryImpl<His
protected
Date
completedDate
;
protected
Date
completedAfterDate
;
protected
Date
completedBeforeDate
;
protected
String
category
;
protected
boolean
includeTaskLocalVariables
=
false
;
protected
boolean
includeProcessVariables
=
false
;
...
...
@@ -398,6 +399,11 @@ public class HistoricTaskInstanceQueryImpl extends AbstractVariableQueryImpl<His
return
this
;
}
public
HistoricTaskInstanceQuery
taskCategory
(
String
category
)
{
this
.
category
=
category
;
return
this
;
}
public
HistoricTaskInstanceQuery
taskCandidateUser
(
String
candidateUser
)
{
if
(
candidateUser
==
null
)
{
throw
new
ActivitiIllegalArgumentException
(
"Candidate user is null"
);
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java
浏览文件 @
3e28c07e
...
...
@@ -60,6 +60,7 @@ public class TaskQueryImpl extends AbstractVariableQueryImpl<TaskQuery, Task> im
protected
Date
createTime
;
protected
Date
createTimeBefore
;
protected
Date
createTimeAfter
;
protected
String
category
;
protected
String
key
;
protected
String
keyLike
;
protected
String
processDefinitionKey
;
...
...
@@ -295,6 +296,11 @@ public class TaskQueryImpl extends AbstractVariableQueryImpl<TaskQuery, Task> im
return
this
;
}
public
TaskQuery
taskCategory
(
String
category
)
{
this
.
category
=
category
;
return
this
;
}
public
TaskQuery
taskDefinitionKey
(
String
key
)
{
this
.
key
=
key
;
return
this
;
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/UserTaskActivityBehavior.java
浏览文件 @
3e28c07e
...
...
@@ -92,6 +92,18 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
}
}
if
(
taskDefinition
.
getCategoryExpression
()
!=
null
)
{
final
Object
category
=
taskDefinition
.
getCategoryExpression
().
getValue
(
execution
);
if
(
category
!=
null
)
{
if
(
category
instanceof
String
)
{
task
.
setCategory
((
String
)
category
);
}
else
{
throw
new
ActivitiIllegalArgumentException
(
"Category expression does not resolve to a string: "
+
taskDefinition
.
getCategoryExpression
().
getExpressionText
());
}
}
}
handleAssignments
(
task
,
execution
);
// All properties set, now firing 'create' event
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/UserTaskParseHandler.java
浏览文件 @
3e28c07e
...
...
@@ -93,6 +93,11 @@ public class UserTaskParseHandler extends AbstractActivityBpmnParseHandler<UserT
taskDefinition
.
setDueDateExpression
(
expressionManager
.
createExpression
(
userTask
.
getDueDate
()));
}
// Category
if
(
StringUtils
.
isNotEmpty
(
userTask
.
getCategory
()))
{
taskDefinition
.
setCategoryExpression
(
expressionManager
.
createExpression
(
userTask
.
getCategory
()));
}
// Priority
if
(
StringUtils
.
isNotEmpty
(
userTask
.
getPriority
()))
{
taskDefinition
.
setPriorityExpression
(
expressionManager
.
createExpression
(
userTask
.
getPriority
()));
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/history/HistoryManager.java
浏览文件 @
3e28c07e
...
...
@@ -463,6 +463,19 @@ public class HistoryManager extends AbstractManager {
}
}
}
/**
* Record task category change, if audit history is enabled.
*/
public
void
recordTaskCategoryChange
(
String
taskId
,
String
category
)
{
if
(
isHistoryLevelAtLeast
(
HistoryLevel
.
AUDIT
))
{
HistoricTaskInstanceEntity
historicTaskInstance
=
getDbSqlSession
().
selectById
(
HistoricTaskInstanceEntity
.
class
,
taskId
);
if
(
historicTaskInstance
!=
null
)
{
historicTaskInstance
.
setCategory
(
category
);
}
}
}
/**
* Record task parent task id change, if audit history is enabled.
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricTaskInstanceEntity.java
浏览文件 @
3e28c07e
...
...
@@ -42,6 +42,7 @@ public class HistoricTaskInstanceEntity extends HistoricScopeInstanceEntity impl
protected
int
priority
;
protected
Date
dueDate
;
protected
Date
claimTime
;
protected
String
category
;
protected
List
<
HistoricVariableInstanceEntity
>
queryVariables
;
public
HistoricTaskInstanceEntity
()
{
...
...
@@ -141,7 +142,13 @@ public class HistoricTaskInstanceEntity extends HistoricScopeInstanceEntity impl
public
void
setDueDate
(
Date
dueDate
)
{
this
.
dueDate
=
dueDate
;
}
public
String
getOwner
()
{
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
String
getOwner
()
{
return
owner
;
}
public
void
setOwner
(
String
owner
)
{
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/TaskEntity.java
浏览文件 @
3e28c07e
...
...
@@ -69,6 +69,7 @@ public class TaskEntity extends VariableScopeImpl implements Task, DelegateTask,
protected
Date
createTime
;
// The time when the task has been created
protected
Date
dueDate
;
protected
int
suspensionState
=
SuspensionState
.
ACTIVE
.
getStateCode
();
protected
String
category
;
protected
boolean
isIdentityLinksInitialized
=
false
;
protected
List
<
IdentityLinkEntity
>
taskIdentityLinkEntities
=
new
ArrayList
<
IdentityLinkEntity
>();
...
...
@@ -511,6 +512,18 @@ public class TaskEntity extends VariableScopeImpl implements Task, DelegateTask,
.
recordTaskPriorityChange
(
id
,
priority
);
}
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
CommandContext
commandContext
=
Context
.
getCommandContext
();
if
(
commandContext
!=
null
)
{
commandContext
.
getHistoryManager
()
.
recordTaskCategoryChange
(
id
,
category
);
}
}
public
void
setPriorityWithoutCascade
(
int
priority
)
{
this
.
priority
=
priority
;
...
...
@@ -713,7 +726,10 @@ public class TaskEntity extends VariableScopeImpl implements Task, DelegateTask,
public
void
setSuspensionState
(
int
suspensionState
)
{
this
.
suspensionState
=
suspensionState
;
}
public
boolean
isSuspended
()
{
public
String
getCategory
()
{
return
category
;
}
public
boolean
isSuspended
()
{
return
suspensionState
==
SuspensionState
.
SUSPENDED
.
getStateCode
();
}
public
Map
<
String
,
Object
>
getTaskLocalVariables
()
{
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/task/TaskDefinition.java
浏览文件 @
3e28c07e
...
...
@@ -44,6 +44,7 @@ public class TaskDefinition implements Serializable {
protected
Set
<
Expression
>
candidateGroupIdExpressions
=
new
HashSet
<
Expression
>();
protected
Expression
dueDateExpression
;
protected
Expression
priorityExpression
;
protected
Expression
categoryExpression
;
// form fields
protected
TaskFormHandler
taskFormHandler
;
...
...
@@ -136,8 +137,16 @@ public class TaskDefinition implements Serializable {
public
void
setDueDateExpression
(
Expression
dueDateExpression
)
{
this
.
dueDateExpression
=
dueDateExpression
;
}
public
Expression
getCategoryExpression
()
{
return
categoryExpression
;
}
public
void
setCategoryExpression
(
Expression
categoryExpression
)
{
this
.
categoryExpression
=
categoryExpression
;
}
public
Map
<
String
,
List
<
TaskListener
>>
getTaskListeners
()
{
public
Map
<
String
,
List
<
TaskListener
>>
getTaskListeners
()
{
return
taskListeners
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/task/Task.java
浏览文件 @
3e28c07e
...
...
@@ -88,6 +88,12 @@ public interface Task {
/** Change due date of the task. */
void
setDueDate
(
Date
dueDate
);
/** The category of the task. This is an optional field and allows to 'tag' tasks as belonging to a certain category. */
String
getCategory
();
/** Change the category of the task. This is an optional field and allows to 'tag' tasks as belonging to a certain category. */
void
setCategory
(
String
category
);
/** delegates this task to the given user and sets the {@link #getDelegationState() delegationState} to {@link DelegationState#PENDING}.
* If no owner is set on the task, the owner is set to the current assignee of the task. */
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/task/TaskQuery.java
浏览文件 @
3e28c07e
...
...
@@ -121,17 +121,20 @@ public interface TaskQuery extends Query<TaskQuery, Task>{
/** Only select tasks for the given execution. */
TaskQuery
executionId
(
String
executionId
);
/** Only select tasks that are created on the given date. *
*
/
/** Only select tasks that are created on the given date. */
TaskQuery
taskCreatedOn
(
Date
createTime
);
/** Only select tasks that are created before the given date. *
*
/
/** Only select tasks that are created before the given date. */
TaskQuery
taskCreatedBefore
(
Date
before
);
/** Only select tasks that are created after the given date. *
*
/
/** Only select tasks that are created after the given date. */
TaskQuery
taskCreatedAfter
(
Date
after
);
/** Only select tasks that have no parent (i.e. do not select subtasks). *
*
/
/** Only select tasks that have no parent (i.e. do not select subtasks). */
TaskQuery
excludeSubtasks
();
/** Only select tasks with the given category. */
TaskQuery
taskCategory
(
String
category
);
/**
* Only select tasks with the given taskDefinitionKey.
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.engine.sql
浏览文件 @
3e28c07e
...
...
@@ -120,6 +120,7 @@ create table ACT_RU_TASK (
PRIORITY_
integer
,
CREATE_TIME_
timestamp
,
DUE_DATE_
timestamp
,
CATEGORY_
varchar
(
255
),
SUSPENSION_STATE_
integer
,
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.history.sql
浏览文件 @
3e28c07e
...
...
@@ -55,6 +55,7 @@ create table ACT_HI_TASKINST (
PRIORITY_
integer
,
DUE_DATE_
timestamp
,
FORM_KEY_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.h2.create.engine.sql
浏览文件 @
3e28c07e
...
...
@@ -118,6 +118,7 @@ create table ACT_RU_TASK (
PRIORITY_
integer
,
CREATE_TIME_
timestamp
,
DUE_DATE_
timestamp
,
CATEGORY_
varchar
(
255
),
SUSPENSION_STATE_
integer
,
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.h2.create.history.sql
浏览文件 @
3e28c07e
...
...
@@ -51,6 +51,7 @@ create table ACT_HI_TASKINST (
PRIORITY_
integer
,
DUE_DATE_
timestamp
,
FORM_KEY_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mssql.create.engine.sql
浏览文件 @
3e28c07e
...
...
@@ -118,6 +118,7 @@ create table ACT_RU_TASK (
PRIORITY_
int
,
CREATE_TIME_
datetime
,
DUE_DATE_
datetime
,
CATEGORY_
nvarchar
(
255
),
SUSPENSION_STATE_
int
,
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mssql.create.history.sql
浏览文件 @
3e28c07e
...
...
@@ -51,6 +51,7 @@ create table ACT_HI_TASKINST (
PRIORITY_
int
,
DUE_DATE_
datetime
,
FORM_KEY_
nvarchar
(
255
),
CATEGORY_
nvarchar
(
255
),
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mysql.create.engine.sql
浏览文件 @
3e28c07e
...
...
@@ -119,6 +119,7 @@ create table ACT_RU_TASK (
PRIORITY_
integer
,
CREATE_TIME_
timestamp
,
DUE_DATE_
datetime
,
CATEGORY_
varchar
(
255
),
SUSPENSION_STATE_
integer
,
primary
key
(
ID_
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
utf8_bin
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mysql.create.history.sql
浏览文件 @
3e28c07e
...
...
@@ -52,6 +52,7 @@ create table ACT_HI_TASKINST (
PRIORITY_
integer
,
DUE_DATE_
datetime
,
FORM_KEY_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
primary
key
(
ID_
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
utf8_bin
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.oracle.create.engine.sql
浏览文件 @
3e28c07e
...
...
@@ -118,6 +118,7 @@ create table ACT_RU_TASK (
PRIORITY_
INTEGER
,
CREATE_TIME_
TIMESTAMP
(
6
),
DUE_DATE_
TIMESTAMP
(
6
),
CATEGORY_
NVARCHAR2
(
255
),
SUSPENSION_STATE_
INTEGER
,
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.oracle.create.history.sql
浏览文件 @
3e28c07e
...
...
@@ -51,6 +51,7 @@ create table ACT_HI_TASKINST (
PRIORITY_
INTEGER
,
DUE_DATE_
TIMESTAMP
(
6
),
FORM_KEY_
NVARCHAR2
(
255
),
CATEGORY_
NVARCHAR2
(
255
),
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.postgres.create.engine.sql
浏览文件 @
3e28c07e
...
...
@@ -119,6 +119,7 @@ create table ACT_RU_TASK (
PRIORITY_
integer
,
CREATE_TIME_
timestamp
,
DUE_DATE_
timestamp
,
CATEGORY_
varchar
(
255
),
SUSPENSION_STATE_
integer
,
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.postgres.create.history.sql
浏览文件 @
3e28c07e
...
...
@@ -52,6 +52,7 @@ create table ACT_HI_TASKINST (
PRIORITY_
integer
,
DUE_DATE_
timestamp
,
FORM_KEY_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
primary
key
(
ID_
)
);
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricTaskInstance.xml
浏览文件 @
3e28c07e
...
...
@@ -39,7 +39,8 @@
TASK_DEF_KEY_,
FORM_KEY_,
PRIORITY_,
DUE_DATE_
DUE_DATE_,
CATEGORY_
) values (
#{id ,jdbcType=VARCHAR},
#{processDefinitionId, jdbcType=VARCHAR},
...
...
@@ -58,7 +59,8 @@
#{taskDefinitionKey ,jdbcType=VARCHAR},
#{formKey ,jdbcType=VARCHAR},
#{priority, jdbcType=INTEGER},
#{dueDate, jdbcType=TIMESTAMP}
#{dueDate, jdbcType=TIMESTAMP},
#{category, jdbcType=VARCHAR}
)
</insert>
...
...
@@ -79,7 +81,8 @@
TASK_DEF_KEY_ = #{taskDefinitionKey ,jdbcType=VARCHAR},
FORM_KEY_ = #{formKey ,jdbcType=VARCHAR},
PRIORITY_ = #{priority, jdbcType=INTEGER},
DUE_DATE_ = #{dueDate, jdbcType=TIMESTAMP}
DUE_DATE_ = #{dueDate, jdbcType=TIMESTAMP},
CATEGORY_ = #{category, jdbcType=VARCHAR}
where ID_ = #{id}
</update>
...
...
@@ -110,6 +113,7 @@
<result
property=
"formKey"
column=
"FORM_KEY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"priority"
column=
"PRIORITY_"
jdbcType=
"INTEGER"
/>
<result
property=
"dueDate"
column=
"DUE_DATE_"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"category"
column=
"CATEGORY_"
jdbcType=
"VARCHAR"
/>
</resultMap>
<resultMap
id=
"historicTaskInstanceAndVariablesResultMap"
type=
"org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity"
>
...
...
@@ -131,6 +135,7 @@
<result
property=
"formKey"
column=
"FORM_KEY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"priority"
column=
"PRIORITY_"
jdbcType=
"INTEGER"
/>
<result
property=
"dueDate"
column=
"DUE_DATE_"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"category"
column=
"CATEGORY_"
jdbcType=
"VARCHAR"
/>
<collection
property=
"queryVariables"
column=
"TASK_ID_"
javaType=
"ArrayList"
ofType=
"org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity"
>
<id
property=
"id"
column=
"VAR_ID_"
/>
<result
property=
"name"
column=
"VAR_NAME_"
javaType=
"String"
jdbcType=
"VARCHAR"
/>
...
...
@@ -380,6 +385,9 @@
<if
test=
"completedAfterDate != null"
>
and RES.END_TIME_
>
#{completedAfterDate}
</if>
<if
test=
"category != null"
>
and RES.CATEGORY_ = #{category}
</if>
<if
test=
"candidateUser != null || candidateGroups != null"
>
and RES.ASSIGNEE_ is null
and HI.TYPE_ = 'candidate'
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Task.xml
浏览文件 @
3e28c07e
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ 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.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.activiti.engine.impl.persistence.entity.TaskEntity"
>
...
...
@@ -8,7 +23,7 @@
<insert
id=
"insertTask"
parameterType=
"org.activiti.engine.impl.persistence.entity.TaskEntity"
>
insert into ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_,
ASSIGNEE_, DELEGATION_, EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_KEY_, DUE_DATE_, SUSPENSION_STATE_)
ASSIGNEE_, DELEGATION_, EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_KEY_, DUE_DATE_,
CATEGORY_,
SUSPENSION_STATE_)
values (#{id, jdbcType=VARCHAR},
1,
#{name, jdbcType=VARCHAR},
...
...
@@ -24,6 +39,7 @@
#{processDefinitionId, jdbcType=VARCHAR},
#{taskDefinitionKey, jdbcType=VARCHAR},
#{dueDate, jdbcType=TIMESTAMP},
#{category, jdbcType=VARCHAR},
#{suspensionState, jdbcType=INTEGER}
)
</insert>
...
...
@@ -45,6 +61,7 @@
PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR},
DESCRIPTION_ = #{description, jdbcType=VARCHAR},
DUE_DATE_ = #{dueDate, jdbcType=TIMESTAMP},
CATEGORY_ = #{category, jdbcType=VARCHAR},
SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER}
</set>
where ID_= #{id, jdbcType=VARCHAR}
...
...
@@ -74,6 +91,7 @@
<result
property=
"processDefinitionId"
column=
"PROC_DEF_ID_"
jdbcType=
"VARCHAR"
/>
<result
property=
"taskDefinitionKeyWithoutCascade"
column=
"TASK_DEF_KEY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"dueDateWithoutCascade"
column=
"DUE_DATE_"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"category"
column=
"CATEGORY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"suspensionState"
column=
"SUSPENSION_STATE_"
jdbcType=
"INTEGER"
/>
</resultMap>
...
...
@@ -93,6 +111,7 @@
<result
property=
"processDefinitionId"
column=
"PROC_DEF_ID_"
jdbcType=
"VARCHAR"
/>
<result
property=
"taskDefinitionKeyWithoutCascade"
column=
"TASK_DEF_KEY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"dueDateWithoutCascade"
column=
"DUE_DATE_"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"category"
column=
"CATEGORY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"suspensionState"
column=
"SUSPENSION_STATE_"
jdbcType=
"INTEGER"
/>
<collection
property=
"queryVariables"
column=
"TASK_ID_"
javaType=
"ArrayList"
ofType=
"org.activiti.engine.impl.persistence.entity.VariableInstanceEntity"
>
<id
property=
"id"
column=
"VAR_ID_"
/>
...
...
@@ -335,6 +354,9 @@
<if
test=
"dueDate != null || dueBefore != null || dueAfter != null"
>
and RES.DUE_DATE_ is not null
</if>
<if
test=
"category != null"
>
and RES.CATEGORY_ = #{category}
</if>
<if
test=
"excludeSubtasks"
>
and RES.PARENT_TASK_ID_ IS NULL
</if>
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.db2.upgradestep.514.to.515.engine.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_RU_TASK
add
CATEGORY_
varchar
(
255
);
update
ACT_GE_PROPERTY
set
VALUE_
=
'5.15-SNAPSHOT'
where
NAME_
=
'schema.version'
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.db2.upgradestep.514.to.515.history.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_HI_TASKINST
add
CATEGORY_
varchar
(
255
);
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.h2.upgradestep.514.to.515.engine.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_RU_TASK
add
CATEGORY_
varchar
(
255
);
update
ACT_GE_PROPERTY
set
VALUE_
=
'5.15-SNAPSHOT'
where
NAME_
=
'schema.version'
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.h2.upgradestep.514.to.515.history.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_HI_TASKINST
add
CATEGORY_
varchar
(
255
);
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mssql.upgradestep.514.to.515.engine.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_RU_TASK
add
CATEGORY_
nvarchar
(
255
);
update
ACT_GE_PROPERTY
set
VALUE_
=
'5.15-SNAPSHOT'
where
NAME_
=
'schema.version'
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mssql.upgradestep.514.to.515.history.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_HI_TASKINST
add
CATEGORY_
nvarchar
(
255
);
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mysql.upgradestep.514.to.515.engine.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_RU_TASK
add
CATEGORY_
varchar
(
255
);
update
ACT_GE_PROPERTY
set
VALUE_
=
'5.15-SNAPSHOT'
where
NAME_
=
'schema.version'
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mysql.upgradestep.514.to.515.history.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_HI_TASKINST
add
CATEGORY_
varchar
(
255
);
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.oracle.upgradestep.514.to.515.engine.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_RU_TASK
add
CATEGORY_
NVARCHAR2
(
255
);
update
ACT_GE_PROPERTY
set
VALUE_
=
'5.15-SNAPSHOT'
where
NAME_
=
'schema.version'
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.oracle.upgradestep.514.to.515.history.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_HI_TASKINST
add
CATEGORY_
NVARCHAR2
(
255
);
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.postgres.upgradestep.514.to.515.engine.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_RU_TASK
add
CATEGORY_
varchar
(
255
);
update
ACT_GE_PROPERTY
set
VALUE_
=
'5.15-SNAPSHOT'
where
NAME_
=
'schema.version'
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.postgres.upgradestep.514.to.515.history.sql
0 → 100644
浏览文件 @
3e28c07e
alter
table
ACT_HI_TASKINST
add
CATEGORY_
varchar
(
255
);
\ No newline at end of file
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/usertask/UserTaskTest.java
浏览文件 @
3e28c07e
...
...
@@ -15,6 +15,7 @@ package org.activiti.engine.test.bpmn.usertask;
import
java.util.List
;
import
org.activiti.engine.history.HistoricTaskInstance
;
import
org.activiti.engine.impl.history.HistoryLevel
;
import
org.activiti.engine.impl.test.PluggableActivitiTestCase
;
import
org.activiti.engine.runtime.ProcessInstance
;
...
...
@@ -72,4 +73,42 @@ public class UserTaskTest extends PluggableActivitiTestCase {
// attempt to complete the task and get PersistenceException pointing to "referential integrity constraint violation"
taskService
.
complete
(
task
.
getId
());
}
@Deployment
public
void
testTaskCategory
()
{
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testTaskCategory"
);
Task
task
=
taskService
.
createTaskQuery
().
singleResult
();
// Test if the property set in the model is shown in the task
String
testCategory
=
"My Category"
;
assertEquals
(
testCategory
,
task
.
getCategory
());
// Test if can be queried by query API
assertEquals
(
"Task with category"
,
taskService
.
createTaskQuery
().
taskCategory
(
testCategory
).
singleResult
().
getName
());
assertTrue
(
taskService
.
createTaskQuery
().
taskCategory
(
"Does not exist"
).
count
()
==
0
);
// Check historic task
HistoricTaskInstance
historicTaskInstance
=
historyService
.
createHistoricTaskInstanceQuery
().
taskId
(
task
.
getId
()).
singleResult
();
assertEquals
(
testCategory
,
historicTaskInstance
.
getCategory
());
assertEquals
(
"Task with category"
,
historyService
.
createHistoricTaskInstanceQuery
().
taskCategory
(
testCategory
).
singleResult
().
getName
());
assertTrue
(
historyService
.
createHistoricTaskInstanceQuery
().
taskCategory
(
"Does not exist"
).
count
()
==
0
);
// Update category
String
newCategory
=
"New Test Category"
;
task
.
setCategory
(
newCategory
);
taskService
.
saveTask
(
task
);
task
=
taskService
.
createTaskQuery
().
singleResult
();
assertEquals
(
newCategory
,
task
.
getCategory
());
assertEquals
(
"Task with category"
,
taskService
.
createTaskQuery
().
taskCategory
(
newCategory
).
singleResult
().
getName
());
assertTrue
(
taskService
.
createTaskQuery
().
taskCategory
(
testCategory
).
count
()
==
0
);
// Complete task and verify history
taskService
.
complete
(
task
.
getId
());
historicTaskInstance
=
historyService
.
createHistoricTaskInstanceQuery
().
taskId
(
task
.
getId
()).
singleResult
();
assertEquals
(
newCategory
,
historicTaskInstance
.
getCategory
());
assertEquals
(
"Task with category"
,
historyService
.
createHistoricTaskInstanceQuery
().
taskCategory
(
newCategory
).
singleResult
().
getName
());
assertTrue
(
historyService
.
createHistoricTaskInstanceQuery
().
taskCategory
(
testCategory
).
count
()
==
0
);
}
}
modules/activiti-engine/src/test/java/org/activiti/examples/mgmt/ManagementServiceTest.java
浏览文件 @
3e28c07e
...
...
@@ -50,7 +50,7 @@ public class ManagementServiceTest extends PluggableActivitiTestCase {
TableMetaData
tableMetaData
=
managementService
.
getTableMetaData
(
tablePrefix
+
"ACT_RU_TASK"
);
assertEquals
(
tableMetaData
.
getColumnNames
().
size
(),
tableMetaData
.
getColumnTypes
().
size
());
assertEquals
(
1
6
,
tableMetaData
.
getColumnNames
().
size
());
assertEquals
(
1
7
,
tableMetaData
.
getColumnNames
().
size
());
int
assigneeIndex
=
tableMetaData
.
getColumnNames
().
indexOf
(
"ASSIGNEE_"
);
int
createTimeIndex
=
tableMetaData
.
getColumnNames
().
indexOf
(
"CREATE_TIME_"
);
...
...
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/usertask/UserTaskTest.testTaskCategory.bpmn20.xml
0 → 100644
浏览文件 @
3e28c07e
<?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=
"testTaskCategory"
>
<documentation>
This is a process for testing purposes
</documentation>
<startEvent
id=
"theStart"
/>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"theTask"
/>
<userTask
id=
"theTask"
name=
"Task with category"
activiti:category=
"My Category"
/>
<sequenceFlow
id=
"flow2"
sourceRef=
"theTask"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
</process>
</definitions>
\ No newline at end of file
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/task/data/HistoricTaskWrapper.java
浏览文件 @
3e28c07e
...
...
@@ -36,6 +36,7 @@ public class HistoricTaskWrapper implements Task {
protected
String
owner
;
protected
String
assignee
;
protected
Date
dueDate
;
protected
String
category
;
protected
String
parentTaskId
;
public
HistoricTaskWrapper
(
HistoricTaskInstance
historicTaskInstance
)
{
...
...
@@ -126,8 +127,16 @@ public class HistoricTaskWrapper implements Task {
public
void
setDueDate
(
Date
dueDate
)
{
this
.
dueDate
=
dueDate
;
}
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
void
delegate
(
String
userId
)
{
public
void
delegate
(
String
userId
)
{
}
public
void
setParentTaskId
(
String
parentTaskId
)
{
...
...
modules/activiti-json-converter/src/main/java/org/activiti/editor/constants/StencilConstants.java
浏览文件 @
3e28c07e
...
...
@@ -123,6 +123,7 @@ public interface StencilConstants {
final
String
PROPERTY_FORMKEY
=
"formkeydefinition"
;
final
String
PROPERTY_DUEDATE
=
"duedatedefinition"
;
final
String
PROPERTY_CATEGORY
=
"categoryDefinition"
;
final
String
PROPERTY_PRIORITY
=
"prioritydefinition"
;
final
String
PROPERTY_USERTASK_ASSIGNMENT
=
"usertaskassignment"
;
...
...
modules/activiti-json-converter/src/main/java/org/activiti/editor/language/json/converter/UserTaskJsonConverter.java
浏览文件 @
3e28c07e
...
...
@@ -90,6 +90,7 @@ public class UserTaskJsonConverter extends BaseBpmnJsonConverter {
}
setPropertyValue
(
PROPERTY_FORMKEY
,
userTask
.
getFormKey
(),
propertiesNode
);
setPropertyValue
(
PROPERTY_DUEDATE
,
userTask
.
getDueDate
(),
propertiesNode
);
setPropertyValue
(
PROPERTY_CATEGORY
,
userTask
.
getCategory
(),
propertiesNode
);;
addFormProperties
(
userTask
.
getFormProperties
(),
propertiesNode
);
}
...
...
@@ -100,6 +101,7 @@ public class UserTaskJsonConverter extends BaseBpmnJsonConverter {
task
.
setPriority
(
getPropertyValueAsString
(
PROPERTY_PRIORITY
,
elementNode
));
task
.
setFormKey
(
getPropertyValueAsString
(
PROPERTY_FORMKEY
,
elementNode
));
task
.
setDueDate
(
getPropertyValueAsString
(
PROPERTY_DUEDATE
,
elementNode
));
task
.
setCategory
(
getPropertyValueAsString
(
PROPERTY_CATEGORY
,
elementNode
));
JsonNode
assignmentNode
=
getProperty
(
PROPERTY_USERTASK_ASSIGNMENT
,
elementNode
);
if
(
assignmentNode
!=
null
)
{
...
...
pom.xml
浏览文件 @
3e28c07e
...
...
@@ -738,6 +738,7 @@
<module>
modules/activiti-bpmn-layout
</module>
<module>
modules/activiti-json-converter
</module>
<module>
modules/activiti-simple-workflow
</module>
<module>
modules/activiti-rest
</module>
<module>
modules/activiti-webapp-rest2
</module>
<module>
modules/activiti-cxf
</module>
<module>
modules/activiti-cdi
</module>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录