1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| package com.iailab.module.bpm.enums.task;
|
| import com.iailab.framework.common.core.IntArrayValuable;
| import com.iailab.framework.common.util.object.ObjectUtils;
| import lombok.AllArgsConstructor;
| import lombok.Getter;
|
| import java.util.Arrays;
|
| /**
| * 流程实例 ProcessInstance 的状态
| *
| * @author iailab
| */
| @Getter
| @AllArgsConstructor
| public enum BpmProcessInstanceStatusEnum implements IntArrayValuable {
|
| NOT_START(-1, "未开始"),
| RUNNING(1, "审批中"),
| APPROVE(2, "审批通过"),
| REJECT(3, "审批不通过"),
| CANCEL(4, "已取消");
|
| public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmProcessInstanceStatusEnum::getStatus).toArray();
|
| /**
| * 状态
| */
| private final Integer status;
| /**
| * 描述
| */
| private final String desc;
|
| @Override
| public int[] array() {
| return ARRAYS;
| }
|
| public static boolean isRejectStatus(Integer status) {
| return REJECT.getStatus().equals(status);
| }
|
| public static boolean isProcessEndStatus(Integer status) {
| return ObjectUtils.equalsAny(status,
| APPROVE.getStatus(), REJECT.getStatus(), CANCEL.getStatus());
| }
|
|
| }
|
|