当前位置:网站首页>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 .
边栏推荐
- Audio and video technology development weekly | 232
- How to dynamically cache components in Vue multi-level route nesting
- Consul of distributed service registration discovery and unified configuration management
- 毕业总结
- functools下的reduce函数
- SDP中的SPA
- 函数计算异步任务能力介绍 - 任务触发去重
- Katalon中控件的参数化
- STM32外接DHT11显示温湿度
- Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
猜你喜欢
SQL語句加强練習(MySQL8.0為例)
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
logistic regression
JVM family -- monitoring tools
JVM family -- heap analysis
Objective-C description method and type method
pytest多进程/多线程执行测试用例
My opinion on how to effectively telecommute | community essay solicitation
SQL statement strengthening exercise (MySQL 8.0 as an example)
图解网络:什么是热备份路由器协议HSRP?
随机推荐
pytest多进程/多线程执行测试用例
Which product is better for 2022 annual gold insurance?
National standard gb28181 protocol platform easygbs fails to start after replacing MySQL database. How to deal with it?
vim正确加区间注释
Apple submitted the new MAC model to the regulatory database before the spring conference
【华为云IoT】读书笔记之《万物互联:物联网核心技术与安全》第3章(上)
vim映射命令
MySQL one master multiple slaves + linear replication
Katalon使用script实现查询List大小
Reduce function under functools
Epidemic strikes -- Thinking about telecommuting | community essay solicitation
How much does it cost to open a futures account in China? Where is it safe to open an account at present?
华为云鲲鹏工程师培训(广西大学)
Smart subway | cloud computing injects wisdom into urban subway transportation
“软硬皆施”,助力建成新型云计算数据中心
Calculate the odd sum of 1~n (1~100 as an example)
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
Development of digital collection trading platform development of digital collection platform
super_ Subclass object memory structure_ Inheritance tree traceability
Deep thinking on investment