-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
3,800 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmBoundaryEventType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.hutool.core.util.ArrayUtil; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* BPM 边界事件 (boundary event) 自定义类型枚举 | ||
* | ||
* @author jason | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum BpmBoundaryEventType { | ||
|
||
USER_TASK_TIMEOUT(1,"用户任务超时"); | ||
|
||
private final Integer type; | ||
private final String name; | ||
|
||
public static BpmBoundaryEventType typeOf(Integer type) { | ||
return ArrayUtil.firstMatch(eventType -> eventType.getType().equals(type), values()); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...pi/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmFieldPermissionEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.hutool.core.util.ArrayUtil; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* BPM 表单权限的枚举 | ||
* | ||
* @author jason | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum BpmFieldPermissionEnum { | ||
|
||
READ(1, "只读"), | ||
WRITE(2, "可编辑"), | ||
NONE(3, "隐藏"); | ||
|
||
/** | ||
* 权限 | ||
*/ | ||
private final Integer permission; | ||
/** | ||
* 名字 | ||
*/ | ||
private final String name; | ||
|
||
public static BpmFieldPermissionEnum valueOf(Integer permission) { | ||
return ArrayUtil.firstMatch(item -> item.getPermission().equals(permission), values()); | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmModelTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* BPM 模型的类型的枚举 | ||
* | ||
* @author 芋道源码 | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum BpmModelTypeEnum implements IntArrayValuable { | ||
|
||
BPMN(10, "BPMN 设计器"), // https://bpmn.io/toolkit/bpmn-js/ | ||
SIMPLE(20, "SIMPLE 设计器"); // 参考钉钉、飞书工作流的设计器 | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelTypeEnum::getType).toArray(); | ||
|
||
private final Integer type; | ||
private final String name; | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...rc/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmSimpleModeConditionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.hutool.core.util.ArrayUtil; | ||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* 仿钉钉的流程器设计器条件节点的条件类型 | ||
* | ||
* @author jason | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum BpmSimpleModeConditionType implements IntArrayValuable { | ||
|
||
EXPRESSION(1, "条件表达式"), | ||
RULE(2, "条件规则"); | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModeConditionType::getType).toArray(); | ||
|
||
private final Integer type; | ||
|
||
private final String name; | ||
|
||
public static BpmSimpleModeConditionType valueOf(Integer type) { | ||
return ArrayUtil.firstMatch(nodeType -> nodeType.getType().equals(type), values()); | ||
} | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
...pi/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmSimpleModelNodeType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.hutool.core.util.ArrayUtil; | ||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
/** | ||
* 仿钉钉的流程器设计器的模型节点类型 | ||
* | ||
* @author jason | ||
*/ | ||
@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, " “parallelGateway”", "条件分支节点"), // TODO @jason:是不是改成叫 条件分支? | ||
PARALLEL_BRANCH_NODE(52, "exclusiveGateway", "并行分支节点"), // TODO @jason:是不是一个 并行分支 ?就可以啦? 后面是否去掉并行网关。只用包容网关 | ||
INCLUSIVE_BRANCH_NODE(53, "inclusiveGateway", "包容分支节点"), | ||
// TODO @jason:建议整合 join,最终只有 条件分支、并行分支、包容分支,三种~ | ||
// TODO @芋艿。 感觉还是分开好理解一点,也好处理一点。前端结构中把聚合节点显示并传过来。 | ||
; | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray(); | ||
|
||
public static final String BPMN_USER_TASK_TYPE = "userTask"; | ||
|
||
private final Integer type; | ||
private final String bpmnType; | ||
private final String name; | ||
|
||
/** | ||
* 判断是否为分支节点 | ||
* | ||
* @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); | ||
} | ||
|
||
/** | ||
* 判断是否需要记录的节点 | ||
* | ||
* @param bpmnType bpmn节点类型 | ||
*/ | ||
public static boolean isRecordNode(String bpmnType) { | ||
return Objects.equals(APPROVE_NODE.getBpmnType(), bpmnType) | ||
|| Objects.equals(END_NODE.getBpmnType(), bpmnType); | ||
} | ||
|
||
public static BpmSimpleModelNodeType valueOf(Integer type) { | ||
return ArrayUtil.firstMatch(nodeType -> nodeType.getType().equals(type), values()); | ||
} | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
.../main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmUserTaskApproveMethodEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.hutool.core.util.ArrayUtil; | ||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* BPM 多人审批方式的枚举 | ||
* | ||
* @author jason | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable { | ||
|
||
RANDOM(1, "随机挑选一人审批"), | ||
RATIO(2, "多人会签(按通过比例)"), // 会签(按通过比例) | ||
ANY(3, "多人或签(一人通过或拒绝)"), // 或签(通过只需一人,拒绝只需一人) | ||
SEQUENTIAL(4, "依次审批"); // 依次审批 | ||
|
||
/** | ||
* 审批方式 | ||
*/ | ||
private final Integer method; | ||
|
||
/** | ||
* 名字 | ||
*/ | ||
private final String name; | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray(); | ||
|
||
public static BpmUserTaskApproveMethodEnum valueOf(Integer method) { | ||
return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values()); | ||
} | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...rc/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmUserTaskApproveTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* 用户任务的审批类型枚举 | ||
* | ||
* @author 芋道源码 | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum BpmUserTaskApproveTypeEnum implements IntArrayValuable { | ||
|
||
USER(1), // 人工审批 | ||
AUTO_APPROVE(2), // 自动通过 | ||
AUTO_REJECT(3); // 自动拒绝 | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveTypeEnum::getType).toArray(); | ||
|
||
private final Integer type; | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...a/cn/iocoder/yudao/module/bpm/enums/definition/BpmUserTaskAssignEmptyHandlerTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* BPM 用户任务的审批人为空时,处理类型枚举 | ||
* | ||
* @author 芋道源码 | ||
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements IntArrayValuable { | ||
|
||
APPROVE(1), // 自动通过 | ||
REJECT(2), // 自动拒绝 | ||
ASSIGN_USER(3), // 指定人员审批 | ||
ASSIGN_ADMIN(4), // 转交给流程管理员 | ||
; | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray(); | ||
|
||
private final Integer type; | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
.../iocoder/yudao/module/bpm/enums/definition/BpmUserTaskAssignStartUserHandlerTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cn.iocoder.yudao.module.bpm.enums.definition; | ||
|
||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* BPM 用户任务的审批人与发起人相同时,处理类型枚举 | ||
* | ||
* @author 芋道源码 | ||
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements IntArrayValuable { | ||
|
||
START_USER_AUDIT(1), // 由发起人对自己审批 | ||
SKIP(2), // 自动跳过【参考飞书】:1)如果当前节点还有其他审批人,则交由其他审批人进行审批;2)如果当前节点没有其他审批人,则该节点自动通过 | ||
TRANSFER_DEPT_LEADER(3); // 转交给部门负责人审批【参考飞书】:若部门负责人为空,则自动通过 | ||
|
||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray(); | ||
|
||
private final Integer type; | ||
|
||
@Override | ||
public int[] array() { | ||
return ARRAYS; | ||
} | ||
|
||
} |
Oops, something went wrong.