1
0

更改部份变量名

This commit is contained in:
2025-01-02 16:09:18 +08:00
parent 422e024b7b
commit 7d88674c66
4 changed files with 13 additions and 13 deletions

View File

@@ -45,7 +45,7 @@ public class JpaFlowableNode {
private String description; private String description;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@Column(nullable = false) @Column(nullable = false)
private FlowableNode.RunType runType; private FlowableNode.Type type;
@ElementCollection(fetch = javax.persistence.FetchType.EAGER) @ElementCollection(fetch = javax.persistence.FetchType.EAGER)
@MapKeyColumn(name = "action") @MapKeyColumn(name = "action")
@Column(name = "nodeId") @Column(name = "nodeId")
@@ -60,12 +60,12 @@ public class JpaFlowableNode {
this.nodeId = node.getNodeId(); this.nodeId = node.getNodeId();
this.name = node.getName(); this.name = node.getName();
this.description = node.getDescription(); this.description = node.getDescription();
this.runType = node.getRunType(); this.type = node.getType();
this.nextNodes = node.getNextNodes(); this.nextNodes = node.getNextNodes();
} }
public FlowableNode toFlowableNode() { public FlowableNode toFlowableNode() {
FlowableNode node = new FlowableNode(nodeId, name, description, runType, nextNodes, null, createdTime); FlowableNode node = new FlowableNode(nodeId, name, description, type, nextNodes, null, createdTime);
node.setUpdatedTime(updateTime); node.setUpdatedTime(updateTime);
return node; return node;
} }

View File

@@ -3,9 +3,9 @@ package com.lanyuanxiaoyao.flowable.core.manager;
import com.lanyuanxiaoyao.flowable.core.helper.ListHelper; import com.lanyuanxiaoyao.flowable.core.helper.ListHelper;
import com.lanyuanxiaoyao.flowable.core.helper.MapHelper; import com.lanyuanxiaoyao.flowable.core.helper.MapHelper;
import com.lanyuanxiaoyao.flowable.core.helper.StringHelper; import com.lanyuanxiaoyao.flowable.core.helper.StringHelper;
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
import com.lanyuanxiaoyao.flowable.core.model.FlowableHistory; import com.lanyuanxiaoyao.flowable.core.model.FlowableHistory;
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance; import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
import com.lanyuanxiaoyao.flowable.core.model.FlowableListener; import com.lanyuanxiaoyao.flowable.core.model.FlowableListener;
import com.lanyuanxiaoyao.flowable.core.model.FlowableNode; import com.lanyuanxiaoyao.flowable.core.model.FlowableNode;
import com.lanyuanxiaoyao.flowable.core.repository.FlowableRepository; import com.lanyuanxiaoyao.flowable.core.repository.FlowableRepository;
@@ -69,7 +69,7 @@ public abstract class FlowableManager {
FlowableInstance instance = new FlowableInstance(idGenerator.createId(), node.getNodeId(), metadata); FlowableInstance instance = new FlowableInstance(idGenerator.createId(), node.getNodeId(), metadata);
flowableRepository.saveInstance(instance); flowableRepository.saveInstance(instance);
if (FlowableNode.RunType.AUTOMATIC.equals(node.getRunType())) { if (FlowableNode.Type.AUTOMATIC.equals(node.getType())) {
action(instance, node, FlowableAction.APPROVE, "系统审批通过", MapHelper.empty()); action(instance, node, FlowableAction.APPROVE, "系统审批通过", MapHelper.empty());
} }
return instance.getInstanceId(); return instance.getInstanceId();
@@ -128,7 +128,7 @@ public abstract class FlowableManager {
instance.setCurrentNodeId(nextNode.getNodeId()); instance.setCurrentNodeId(nextNode.getNodeId());
saveInstance(instance, FlowableInstance.Status.RUNNING, metadata, action, comment); saveInstance(instance, FlowableInstance.Status.RUNNING, metadata, action, comment);
if (FlowableNode.RunType.AUTOMATIC.equals(nextNode.getRunType())) { if (FlowableNode.Type.AUTOMATIC.equals(nextNode.getType())) {
action(instance, node, FlowableAction.APPROVE, "系统审批通过", metadata); action(instance, node, FlowableAction.APPROVE, "系统审批通过", metadata);
} }
} }

View File

@@ -17,28 +17,28 @@ public class FlowableNode {
private final String nodeId; private final String nodeId;
private final String name; private final String name;
private final String description; private final String description;
private final RunType runType; private final Type type;
private final Map<FlowableAction, String> nextNodes; private final Map<FlowableAction, String> nextNodes;
private final List<Class<? extends FlowableListener>> listeners; private final List<Class<? extends FlowableListener>> listeners;
private final LocalDateTime createdTime; private final LocalDateTime createdTime;
private LocalDateTime updatedTime = LocalDateTime.now(); private LocalDateTime updatedTime = LocalDateTime.now();
public FlowableNode(String nodeId, String name, String description, RunType runType, Map<FlowableAction, String> nextNodes) { public FlowableNode(String nodeId, String name, String description, Type type, Map<FlowableAction, String> nextNodes) {
this(nodeId, name, description, runType, nextNodes, ListHelper.empty(), LocalDateTime.now()); this(nodeId, name, description, type, nextNodes, ListHelper.empty(), LocalDateTime.now());
} }
public FlowableNode(String nodeId, String name, String description, RunType runType, Map<FlowableAction, String> nextNodes, List<Class<? extends FlowableListener>> listeners, LocalDateTime createdTime) { public FlowableNode(String nodeId, String name, String description, Type type, Map<FlowableAction, String> nextNodes, List<Class<? extends FlowableListener>> listeners, LocalDateTime createdTime) {
this.nodeId = nodeId; this.nodeId = nodeId;
this.name = name; this.name = name;
this.description = description; this.description = description;
this.runType = runType; this.type = type;
this.nextNodes = nextNodes; this.nextNodes = nextNodes;
this.listeners = listeners; this.listeners = listeners;
this.createdTime = createdTime; this.createdTime = createdTime;
} }
public enum RunType { public enum Type {
AUTOMATIC, AUTOMATIC,
MANUAL, MANUAL,
} }

View File

@@ -34,7 +34,7 @@ public abstract class TestFlowableManager {
nodeId, nodeId,
UUID.randomUUID().toString(), UUID.randomUUID().toString(),
UUID.randomUUID().toString(), UUID.randomUUID().toString(),
FlowableNode.RunType.MANUAL, FlowableNode.Type.MANUAL,
nextNodes nextNodes
); );
} }