| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskApproveMethodEnum implements ArrayValuable { |
| | | |
| | | RANDOM(1, "随机挑选一人审批", null), |
| | | RATIO(2, "多人会签(按通过比例)", "${ nrOfCompletedInstances/nrOfInstances >= %s}"), // 会签(按通过比例) |
| | |
| | | */ |
| | | private final String completionCondition; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveMethodEnum::getMethod).toArray(Integer[]::new); |
| | | |
| | | public static BpmUserTaskApproveMethodEnum valueOf(Integer method) { |
| | | return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values()); |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |