提交 | 用户 | 时间
|
bb2880
|
1 |
package com.iailab.module.bpm.enums.definition; |
H |
2 |
|
|
3 |
import cn.hutool.core.util.ArrayUtil; |
|
4 |
import com.iailab.framework.common.core.IntArrayValuable; |
|
5 |
import lombok.AllArgsConstructor; |
|
6 |
import lombok.Getter; |
|
7 |
|
|
8 |
import java.util.Arrays; |
|
9 |
|
|
10 |
/** |
|
11 |
* BPM 多人审批方式的枚举 |
|
12 |
* |
|
13 |
* @author hou |
|
14 |
*/ |
|
15 |
@Getter |
|
16 |
@AllArgsConstructor |
|
17 |
public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable { |
|
18 |
|
|
19 |
RANDOM(1, "随机挑选一人审批", null), |
|
20 |
RATIO(2, "多人会签(按通过比例)", "${ nrOfCompletedInstances/nrOfInstances >= %s}"), // 会签(按通过比例) |
|
21 |
ANY(3, "多人或签(一人通过或拒绝)", "${ nrOfCompletedInstances > 0 }"), // 或签(通过只需一人,拒绝只需一人) |
|
22 |
SEQUENTIAL(4, "依次审批", "${ nrOfCompletedInstances >= nrOfInstances }"); // 依次审批 |
|
23 |
|
|
24 |
/** |
|
25 |
* 审批方式 |
|
26 |
*/ |
|
27 |
private final Integer method; |
|
28 |
/** |
|
29 |
* 名字 |
|
30 |
*/ |
|
31 |
private final String name; |
|
32 |
/** |
|
33 |
* 完成表达式 |
|
34 |
*/ |
|
35 |
private final String completionCondition; |
|
36 |
|
|
37 |
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray(); |
|
38 |
|
|
39 |
public static BpmUserTaskApproveMethodEnum valueOf(Integer method) { |
|
40 |
return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values()); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public int[] array() { |
|
45 |
return ARRAYS; |
|
46 |
} |
|
47 |
} |