增加挂起操作
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -10,4 +10,5 @@ public enum FlowableAction {
|
||||
APPROVE,
|
||||
REJECT,
|
||||
TERMINAL,
|
||||
SUSPEND,
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user