当前位置:网站首页>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 .
边栏推荐
- PostgreSQL users cannot create table configurations by themselves
- JVM family -- monitoring tools
- 【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装
- Aperçu du code source futur - série juc
- New year's first race, submit bug reward more!
- Wechat official account web page authorization
- [paddleseg source code reading] normalize operation of paddleseg transform
- 思考的小记录
- [book club issue 13] packaging format of video files
- 疫情来袭--远程办公之思考|社区征文
猜你喜欢

MySQL maxscale realizes read-write separation

JVM family -- monitoring tools

Want to do something in production? Then try these redis commands

MySQL is dirty

Getting started with the go language is simple: go implements the Caesar password

Sales management system of lightweight enterprises based on PHP
![[paddleseg source code reading] paddleseg custom data class](/img/88/37c535b371486db545abc392a685af.png)
[paddleseg source code reading] paddleseg custom data class

基于PHP的轻量企业销售管理系统

函数计算异步任务能力介绍 - 任务触发去重

拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
随机推荐
LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
Is it safe to buy insurance for your children online? Do you want to buy a million dollar medical insurance for your children?
Katalon framework tests web (XXI) to obtain element attribute assertions
如何有效远程办公之我见 | 社区征文
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
深度优先搜索简要讲解(附带基础题)
postgresql 用户不能自己创建表格配置
Session learning diary 1
Smart subway | cloud computing injects wisdom into urban subway transportation
JVM family -- monitoring tools
Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
Katalon框架测试web(二十一)获取元素属性断言
Pytest multi process / multi thread execution test case
疫情来袭--远程办公之思考|社区征文
Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
Pytest multi process / multi thread execution test case
JVM family -- heap analysis
【读书会第十三期】多媒体处理工具 FFmpeg 工具集
【.NET+MQTT】.NET6 環境下實現MQTT通信,以及服務端、客戶端的雙邊消息訂閱與發布的代碼演示
SQL语句加强练习(MySQL8.0为例)