当前位置:网站首页>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
setVariableMethod 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
setVariableLocalThe 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 .
边栏推荐
- 新型数据中心,助力加快构建以数据为关键要素的数字经济
- [source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
- The property of judging odd or even numbers about XOR.
- [PaddleSeg 源码阅读] PaddleSeg Transform 的 Normalize操作
- Learning video website
- vim正确加区间注释
- 智慧地铁| 云计算为城市地铁交通注入智慧
- [book club issue 13] packaging format of video files
- LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
- 微信公众号网页授权
猜你喜欢

My opinion on how to effectively telecommute | community essay solicitation

EV6 helps the product matrix, and Kia is making efforts in the high-end market. The global sales target in 2022 is 3.15 million?

laravel admin里百度编辑器自定义路径和文件名

SQL statement strengthening exercise (MySQL 8.0 as an example)

ctf-pikachu-CSRF

JSON string conversion in unity

LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)

Wechat official account web page authorization

Want to do something in production? Then try these redis commands
![[untitled]](/img/b5/bf76783aa428222623d760756a14d9.jpg)
[untitled]
随机推荐
vim映射命令
Es network layer
Zigzag scan
Huawei cloud Kunpeng engineer training (Guangxi University)
Zlmediakit compilation and webrtc push-pull flow testing
What are the virtual machine software? What are their respective functions?
Eh, the log time of MySQL server is less than 8h?
MySQL backup notes
函数计算异步任务能力介绍 - 任务触发去重
用于TCP协议交互的TCPClientDemo
支持首次触发的 Go Ticker
Getting started with the go language is simple: go implements the Caesar password
CSP drawing
How much does it cost to open a futures account in China? Where is it safe to open an account at present?
Illustrated network: what is the hot backup router protocol HSRP?
Management and thesis of job management system based on SSM
Support the first triggered go ticker
微信公众号网页授权
SDP中的SPA
vue多级路由嵌套怎么动态缓存组件