mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
update 初始化流程变量,确保默认值为 HashMap,简化变量获取逻辑
This commit is contained in:
parent
bcd5bb0f86
commit
694e084710
@ -57,13 +57,6 @@ public class BackProcessBo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 流程变量
|
* 流程变量
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables = new HashMap<>();
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
|
||||||
if (variables == null) {
|
|
||||||
return new HashMap<>(16);
|
|
||||||
}
|
|
||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
|
||||||
return variables;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import java.io.Serializable;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 办理任务请求对象
|
* 办理任务请求对象
|
||||||
@ -61,7 +60,7 @@ public class CompleteTaskBo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 流程变量
|
* 流程变量
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 弹窗选择的办理人
|
* 弹窗选择的办理人
|
||||||
@ -73,13 +72,4 @@ public class CompleteTaskBo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String ext;
|
private String ext;
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
|
||||||
if (variables == null) {
|
|
||||||
variables = new HashMap<>(16);
|
|
||||||
return variables;
|
|
||||||
}
|
|
||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
|
||||||
return variables;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import java.io.Serial;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下一节点信息
|
* 下一节点信息
|
||||||
@ -26,13 +25,6 @@ public class FlowNextNodeBo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 流程变量
|
* 流程变量
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables = new HashMap<>();
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
|
||||||
if (variables == null) {
|
|
||||||
return new HashMap<>(16);
|
|
||||||
}
|
|
||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
|
||||||
return variables;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package org.dromara.workflow.domain.bo;
|
package org.dromara.workflow.domain.bo;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
@ -11,7 +10,6 @@ import java.io.Serial;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动流程对象
|
* 启动流程对象
|
||||||
@ -44,25 +42,11 @@ public class StartProcessBo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程业务扩展信息
|
* 流程业务扩展信息
|
||||||
*/
|
*/
|
||||||
private FlowInstanceBizExt bizExt;
|
private FlowInstanceBizExt bizExt = new FlowInstanceBizExt();
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
|
||||||
if (variables == null) {
|
|
||||||
return new HashMap<>(16);
|
|
||||||
}
|
|
||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
|
||||||
return variables;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FlowInstanceBizExt getBizExt() {
|
|
||||||
if (ObjectUtil.isNull(bizExt)) {
|
|
||||||
bizExt = new FlowInstanceBizExt();
|
|
||||||
}
|
|
||||||
return bizExt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -40,6 +41,6 @@ public class NodeExtVo implements Serializable {
|
|||||||
* <p>
|
* <p>
|
||||||
* 根据扩展属性中 VariablesEnum 类型的数据生成,存储 key=value 格式的自定义参数
|
* 根据扩展属性中 VariablesEnum 类型的数据生成,存储 key=value 格式的自定义参数
|
||||||
*/
|
*/
|
||||||
private Map<String, String> variables;
|
private Map<String, String> variables = new HashMap<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user