反序列化问题。

This commit is contained in:
dengqichen 2024-12-20 17:03:56 +08:00
parent 3b9b075360
commit 253b106454
3 changed files with 9 additions and 12 deletions

View File

@ -1,7 +1,6 @@
package com.qqchen.deploy.backend.workflow.dto.definition.workflow;
import com.fasterxml.jackson.databind.JsonNode;
import com.qqchen.deploy.backend.workflow.dto.definition.node.uiVariables.NodeUiVariables;
import com.qqchen.deploy.backend.workflow.enums.NodeTypeEnums;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -16,26 +15,26 @@ import java.util.Map;
*/
@Data
public class WorkflowDefinitionNode {
/**
* 节点ID
*/
private String id;
/**
* 节点Code
*/
private String code;
private String nodeCode;
/**
* 节点类型
*/
private NodeTypeEnums type;
private NodeTypeEnums nodeType;
/**
* 节点名称
*/
private String name;
private String nodeName;
@Schema(description = "节点UI")
private JsonNode uiVariables;
@ -46,7 +45,7 @@ public class WorkflowDefinitionNode {
@Schema(description = "节点环境变量")
private JsonNode localVariables;
@Schema(description = "节点表单")
private JsonNode formVariables;
@Schema(description = "节点表单 JSON SCHEMA")
private JsonNode formVariablesSchema;
}

View File

@ -71,8 +71,6 @@ public class WorkflowDefinitionServiceImpl extends BaseServiceImpl<WorkflowDefin
@Resource
private BpmnConverter bpmnConverter;
@Resource
private IWorkflowInstanceService workflowInstanceService;
@Override
@Transactional(rollbackFor = Exception.class)

View File

@ -59,11 +59,11 @@ public class BpmnConverter {
// 转换节点
for (WorkflowDefinitionNode node : graph.getNodes()) {
log.debug("转换节点: {}, 类型: {}", node.getName(), node.getCode());
log.debug("转换节点: {}, 类型: {}", node.getNodeName(), node.getNodeCode());
// 通过NodeTypeEnums获取对应的BpmnTypeEnums中定义的实例类型
@SuppressWarnings("unchecked")
Class<? extends FlowElement> instanceClass = (Class<? extends FlowElement>) NodeTypeEnums.valueOf(node.getCode())
Class<? extends FlowElement> instanceClass = (Class<? extends FlowElement>) NodeTypeEnums.valueOf(node.getNodeCode())
.getBpmnType()
.getInstance();
@ -72,7 +72,7 @@ public class BpmnConverter {
String validId = sanitizeId(node.getId());
idMapping.put(node.getId(), validId);
element.setId(validId);
element.setName(node.getName());
element.setName(node.getNodeName());
// 设置节点特定属性
configureFlowElement(element, node, process);