diff --git a/adapter/flowable-spring-boot-jpa-starter/src/main/java/com/lanyuanxiaoyao/flowable/jpa/entity/JpaFlowableNode.java b/adapter/flowable-spring-boot-jpa-starter/src/main/java/com/lanyuanxiaoyao/flowable/jpa/entity/JpaFlowableNode.java index 4d56d1d..d38eb75 100644 --- a/adapter/flowable-spring-boot-jpa-starter/src/main/java/com/lanyuanxiaoyao/flowable/jpa/entity/JpaFlowableNode.java +++ b/adapter/flowable-spring-boot-jpa-starter/src/main/java/com/lanyuanxiaoyao/flowable/jpa/entity/JpaFlowableNode.java @@ -45,7 +45,7 @@ public class JpaFlowableNode { private String description; @Enumerated(EnumType.STRING) @Column(nullable = false) - private FlowableNode.RunType runType; + private FlowableNode.Type type; @ElementCollection(fetch = javax.persistence.FetchType.EAGER) @MapKeyColumn(name = "action") @Column(name = "nodeId") @@ -60,12 +60,12 @@ public class JpaFlowableNode { this.nodeId = node.getNodeId(); this.name = node.getName(); this.description = node.getDescription(); - this.runType = node.getRunType(); + this.type = node.getType(); this.nextNodes = node.getNextNodes(); } 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); return node; } diff --git a/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/manager/FlowableManager.java b/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/manager/FlowableManager.java index 3b3fb5d..c84c4d9 100644 --- a/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/manager/FlowableManager.java +++ b/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/manager/FlowableManager.java @@ -3,9 +3,9 @@ package com.lanyuanxiaoyao.flowable.core.manager; import com.lanyuanxiaoyao.flowable.core.helper.ListHelper; import com.lanyuanxiaoyao.flowable.core.helper.MapHelper; 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.FlowableInstance; -import com.lanyuanxiaoyao.flowable.core.model.FlowableAction; import com.lanyuanxiaoyao.flowable.core.model.FlowableListener; import com.lanyuanxiaoyao.flowable.core.model.FlowableNode; import com.lanyuanxiaoyao.flowable.core.repository.FlowableRepository; @@ -69,7 +69,7 @@ public abstract class FlowableManager { FlowableInstance instance = new FlowableInstance(idGenerator.createId(), node.getNodeId(), metadata); flowableRepository.saveInstance(instance); - if (FlowableNode.RunType.AUTOMATIC.equals(node.getRunType())) { + if (FlowableNode.Type.AUTOMATIC.equals(node.getType())) { action(instance, node, FlowableAction.APPROVE, "系统审批通过", MapHelper.empty()); } return instance.getInstanceId(); @@ -128,7 +128,7 @@ public abstract class FlowableManager { instance.setCurrentNodeId(nextNode.getNodeId()); 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); } } diff --git a/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/model/FlowableNode.java b/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/model/FlowableNode.java index bba1667..8b73543 100644 --- a/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/model/FlowableNode.java +++ b/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/model/FlowableNode.java @@ -17,28 +17,28 @@ public class FlowableNode { private final String nodeId; private final String name; private final String description; - private final RunType runType; + private final Type type; private final Map nextNodes; private final List> listeners; private final LocalDateTime createdTime; private LocalDateTime updatedTime = LocalDateTime.now(); - public FlowableNode(String nodeId, String name, String description, RunType runType, Map nextNodes) { - this(nodeId, name, description, runType, nextNodes, ListHelper.empty(), LocalDateTime.now()); + public FlowableNode(String nodeId, String name, String description, Type type, Map nextNodes) { + this(nodeId, name, description, type, nextNodes, ListHelper.empty(), LocalDateTime.now()); } - public FlowableNode(String nodeId, String name, String description, RunType runType, Map nextNodes, List> listeners, LocalDateTime createdTime) { + public FlowableNode(String nodeId, String name, String description, Type type, Map nextNodes, List> listeners, LocalDateTime createdTime) { this.nodeId = nodeId; this.name = name; this.description = description; - this.runType = runType; + this.type = type; this.nextNodes = nextNodes; this.listeners = listeners; this.createdTime = createdTime; } - public enum RunType { + public enum Type { AUTOMATIC, MANUAL, } diff --git a/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/test/TestFlowableManager.java b/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/test/TestFlowableManager.java index 957a694..eefa04e 100644 --- a/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/test/TestFlowableManager.java +++ b/flowable-core/src/main/java/com/lanyuanxiaoyao/flowable/core/test/TestFlowableManager.java @@ -34,7 +34,7 @@ public abstract class TestFlowableManager { nodeId, UUID.randomUUID().toString(), UUID.randomUUID().toString(), - FlowableNode.RunType.MANUAL, + FlowableNode.Type.MANUAL, nextNodes ); }