From 6b13839488edcd06046e26a41fe897358176689c Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 13 十二月 2024 17:56:41 +0800
Subject: [PATCH] 采集质量

---
 iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmSimpleModelNodeType.java |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmSimpleModelNodeType.java b/iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmSimpleModelNodeType.java
new file mode 100644
index 0000000..e74cb02
--- /dev/null
+++ b/iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmSimpleModelNodeType.java
@@ -0,0 +1,62 @@
+package com.iailab.module.bpm.enums.definition;
+
+import cn.hutool.core.util.ArrayUtil;
+import com.iailab.framework.common.core.IntArrayValuable;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+/**
+ * 仿钉钉的流程器设计器的模型节点类型
+ *
+ * @author hou
+ */
+@Getter
+@AllArgsConstructor
+public enum BpmSimpleModelNodeType implements IntArrayValuable {
+
+    // 0 ~ 1 开始和结束
+    START_NODE(0, "开始", "startEvent"),
+    END_NODE(1, "结束", "endEvent"),
+
+    // 10 ~ 49 各种节点
+    START_USER_NODE(10, "发起人", "userTask"), // 发起人节点。前端的开始节点,Id 固定
+    APPROVE_NODE(11, "审批人", "userTask"),
+    COPY_NODE(12, "抄送人", "serviceTask"),
+
+    // 50 ~ 条件分支
+    CONDITION_NODE(50, "条件", "sequenceFlow"), // 用于构建流转条件的表达式
+    CONDITION_BRANCH_NODE(51, "条件分支", "exclusiveGateway"),
+    PARALLEL_BRANCH_NODE(52, "并行分支", "parallelGateway"),
+    INCLUSIVE_BRANCH_NODE(53, "包容分支", "inclusiveGateway"),
+    ;
+
+    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
+
+    private final Integer type;
+    private final String name;
+    private final String bpmnType;
+
+    /**
+     * 判断是否为分支节点
+     *
+     * @param type 节点类型
+     */
+    public static boolean isBranchNode(Integer type) {
+        return Objects.equals(CONDITION_BRANCH_NODE.getType(), type)
+                || Objects.equals(PARALLEL_BRANCH_NODE.getType(), type)
+                || Objects.equals(INCLUSIVE_BRANCH_NODE.getType(), type);
+    }
+
+    public static BpmSimpleModelNodeType valueOf(Integer type) {
+        return ArrayUtil.firstMatch(nodeType -> nodeType.getType().equals(type), values());
+    }
+
+    @Override
+    public int[] array() {
+        return ARRAYS;
+    }
+
+}

--
Gitblit v1.9.3