当前位置:网站首页>Activiti7 task service - process variables (setvariable and setvariablelocal)
Activiti7 task service - process variables (setvariable and setvariablelocal)
2022-07-04 04:03:00 【keep-go-on】
The role of process variables
The role of task variables mainly consists of the following roles .
- Task undertaker parameters . Task start or midway through the variable to specify the task acceptor .
- Gateway condition variable . Provide data for the gateway when the task starts or midway .
- Task extension attribute . Provide extended attributes for tasks , Available for retrieval .
- Dynamically modify the attributes of the process .
Task services provide setVariableLocal
and setVariable
Two methods provide methods to set variables for processes and tasks . The runtime process variable table is act_ru_variable
.
Task service setVariable Method
How to use it is as follows :
taskService.setVariable(taskId,key,value);
Database result :
Use
setVariable
Method to set process variables , The granularity associated with variables is the process instance ID(PROC_INST_ID_) Not the task ID, Process variables belong to the global .
Task service setVariableLocal Method
How to use it is as follows :
taskService.setVariableLocal(taskId,key,value);
The database results are as follows :
Use
setVariableLocal
The variable granularity set by the method is directly related to the task ID, Variables belong to tasks ( A task is a process node ) Of .
The difference between queries
Query global variables
taskQuery.taskVariableValueEquals("test_var","099098087");
Query global variables ( Use setVariable
Method to set process variables ), Query results :
{
{
"code": 10000,
"msg": " success ",
"status": true,
"data": {
"records": [],
"total": 0,
"size": 10,
"current": 1,
"orders": [],
"optimizeCountSql": true,
"searchCount": true,
"pages": 0
}
}
Because the global variable is not associated with the task task , Therefore, the task cannot be queried .
Query task variables
taskQuery.taskVariableValueEquals("test_varrrrr","099098087");
The query results are as follows :
{
"code": 10000,
"msg": " success ",
"status": true,
"data": {
"records": [
{
"taskId": "ffd43354-8bde-11ec-a6d1-b42e996769a4",
"taskName": " Approved by ",
"processInstanceId": "ffc1bcb7-8bde-11ec-a6d1-b42e996769a4",
"processDefinitionId": "635cc307-8a6b-11ec-9c5b-b42e996769a4",
"createTime": "2022-02-12T08:37:23.272+00:00",
"taskDefinitionKey": "node_92754730680",
"assignee": "user_C"
}
],
"total": 1,
"size": 10,
"current": 1,
"orders": [],
"optimizeCountSql": true,
"searchCount": true,
"pages": 1
}
}
According to the screenshot above, we can see , The task queried is the task associated with the task .
边栏推荐
- Es network layer
- MySQL one master multiple slaves + linear replication
- 深度优先搜索简要讲解(附带基础题)
- warning: LF will be replaced by CRLF in XXXXXX
- A review of reverse reinforcement learning at Virginia Tech (VT)
- 数据库SQL语句汇总,持续更新......
- Session learning diary 1
- Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
- 【读书会第十三期】多媒体处理工具 FFmpeg 工具集
- Defensive programming skills
猜你喜欢
随机推荐
Getting started with the go language is simple: go implements the Caesar password
疫情来袭--远程办公之思考|社区征文
Select sorting and bubble sorting template
Add IDM to Google browser
pytest多进程/多线程执行测试用例
Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
微信公众号网页授权
Typical applications of minimum spanning tree
JVM family -- monitoring tools
Which product is better if you want to go abroad to insure Xinguan?
AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving
[paddleseg source code reading] paddleseg calculation dice
Summary of Chinese remainder theorem
pytest多进程/多线程执行测试用例
Defensive programming skills
Easy to win insert sort
Katalon框架测试web(二十一)获取元素属性断言
[PaddleSeg 源码阅读] PaddleSeg计算Dice
Calculate the odd sum of 1~n (1~100 as an example)
MySQL is dirty