yxk-20260506-自定义流程表达式:

setProcessVariable可以写入主流程变量/子流程局部变量
增加了 taskId、executionId、local 字段
传 local: true 且有 taskId 时,通过 taskId 查当前 executionId
调用 runtimeService.setVariableLocal(executionId, 'subApproveUser', value)
不传 local/taskId/executionId 时,保持原来的 setVariable(processInstanceId, ...) 行为
This commit is contained in:
ye1023
2026-05-03 11:38:24 +08:00
parent f7b6518038
commit 876af1c706
@@ -84,6 +84,11 @@ public class ActProcessController {
@PostMapping(value = "/setProcessVariable")
@Operation(summary = "设置流程变量")
// 增加了 taskId、executionId、local 字段
// 传 local: true 且有 taskId 时,通过 taskId 查当前 executionId
// 调用 runtimeService.setVariableLocal(executionId, 'subApproveUser', value)
// 不传 local/taskId/executionId 时,保持原来的 setVariable(processInstanceId, ...) 行为
public Result<String> setProcessVariable(@RequestBody ProcessVariableDTO dto) {
if (dto == null || oConvertUtils.isEmpty(dto.getProcessInstanceId())) {
return Result.error("流程实例ID不能为空");