1
0

增加挂起操作

This commit is contained in:
2025-01-03 12:36:49 +08:00
parent 040b980a8b
commit b69da9a4e4
6 changed files with 65 additions and 3 deletions

View File

@@ -129,6 +129,11 @@ public abstract class FlowableManager {
throw new IllegalArgumentException("节点执行结果不能为空");
}
// 如果是挂起操作,就直接返回,不做操作
if (FlowableAction.SUSPEND.equals(action)) {
return;
}
if (FlowableAction.TERMINAL.equals(action)) {
saveInstance(instance, FlowableInstance.Status.ERROR, metadata, action, comment);
return;

View File

@@ -10,4 +10,5 @@ public enum FlowableAction {
APPROVE,
REJECT,
TERMINAL,
SUSPEND,
}

View File

@@ -17,7 +17,7 @@ public class FlowableInstance {
private String currentNodeId;
private Status status;
private LocalDateTime updatedTime = LocalDateTime.now();
private LocalDateTime updatedTime;
public FlowableInstance(String instanceId, String currentNodeId) {
this(instanceId, currentNodeId, MapHelper.empty(), Status.RUNNING, LocalDateTime.now(), LocalDateTime.now());

View File

@@ -28,11 +28,15 @@ public class FlowableNode {
private LocalDateTime updatedTime = LocalDateTime.now();
public FlowableNode(String nodeId, String name, String description, Map<FlowableAction, String> targets) {
this(nodeId, name, description, Type.MANUAL, FlowableHandler.DefaultFlowableHandler.class.getName(), targets, ListHelper.empty(), LocalDateTime.now());
this(nodeId, name, description, Type.MANUAL, FlowableHandler.DefaultFlowableHandler.class, targets);
}
public FlowableNode(String nodeId, String name, String description, Class<? extends FlowableHandler> actionClass, Map<FlowableAction, String> targets) {
this(nodeId, name, description, Type.AUTOMATIC, actionClass.getName(), targets, ListHelper.empty(), LocalDateTime.now());
this(nodeId, name, description, Type.AUTOMATIC, actionClass, targets);
}
public FlowableNode(String nodeId, String name, String description, Type type, Class<? extends FlowableHandler> actionClass, Map<FlowableAction, String> targets) {
this(nodeId, name, description, type, actionClass.getName(), targets, ListHelper.empty(), LocalDateTime.now());
}
public FlowableNode(String nodeId, String name, String description, Type type, String handler, Map<FlowableAction, String> targets, List<String> listeners, LocalDateTime createdTime) {