【代码评审】Bpm:触发器的实现
This commit is contained in:
@@ -13,13 +13,13 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmAutoApproveType implements IntArrayValuable {
|
||||
public enum BpmAutoApproveTypeEnum implements IntArrayValuable {
|
||||
|
||||
NONE(0, "不自动通过"),
|
||||
APPROVE_ALL(1, "仅审批一次,后续重复的审批节点均自动通过"),
|
||||
APPROVE_SEQUENT(2, "仅针对连续审批的节点自动通过");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmAutoApproveType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmAutoApproveTypeEnum::getType).toArray();
|
||||
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
@@ -11,7 +11,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmBoundaryEventType {
|
||||
public enum BpmBoundaryEventTypeEnum {
|
||||
|
||||
USER_TASK_TIMEOUT(1, "用户任务超时"),
|
||||
DELAY_TIMER_TIMEOUT(2, "延迟器超时");
|
||||
@@ -19,7 +19,7 @@ public enum BpmBoundaryEventType {
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static BpmBoundaryEventType typeOf(Integer type) {
|
||||
public static BpmBoundaryEventTypeEnum typeOf(Integer type) {
|
||||
return ArrayUtil.firstMatch(eventType -> eventType.getType().equals(type), values());
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmDelayTimerType implements IntArrayValuable {
|
||||
public enum BpmDelayTimerTypeEnum implements IntArrayValuable {
|
||||
|
||||
FIXED_TIME_DURATION(1, "固定时长"),
|
||||
FIXED_DATE_TIME(2, "固定日期");
|
||||
@@ -21,7 +21,7 @@ public enum BpmDelayTimerType implements IntArrayValuable {
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmDelayTimerType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmDelayTimerTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
@@ -13,7 +13,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmHttpRequestParamSettingType implements IntArrayValuable {
|
||||
public enum BpmHttpRequestParamTypeEnum implements IntArrayValuable {
|
||||
|
||||
FIXED_VALUE(1, "固定值"),
|
||||
FROM_FORM(2, "表单");
|
||||
@@ -21,7 +21,7 @@ public enum BpmHttpRequestParamSettingType implements IntArrayValuable {
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmHttpRequestParamSettingType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmHttpRequestParamTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmProcessListenerType {
|
||||
public enum BpmProcessListenerTypeEnum {
|
||||
|
||||
EXECUTION("execution", "执行监听器"),
|
||||
TASK("task", "任务执行器");
|
||||
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmProcessListenerValueType {
|
||||
public enum BpmProcessListenerValueTypeEnum {
|
||||
|
||||
CLASS("class", "Java 类"),
|
||||
DELEGATE_EXPRESSION("delegateExpression", "代理表达式"),
|
||||
@@ -14,18 +14,18 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmSimpleModeConditionType implements IntArrayValuable {
|
||||
public enum BpmSimpleModeConditionTypeEnum implements IntArrayValuable {
|
||||
|
||||
EXPRESSION(1, "条件表达式"),
|
||||
RULE(2, "条件规则");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModeConditionType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModeConditionTypeEnum::getType).toArray();
|
||||
|
||||
private final Integer type;
|
||||
|
||||
private final String name;
|
||||
|
||||
public static BpmSimpleModeConditionType valueOf(Integer type) {
|
||||
public static BpmSimpleModeConditionTypeEnum valueOf(Integer type) {
|
||||
return ArrayUtil.firstMatch(nodeType -> nodeType.getType().equals(type), values());
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
||||
public enum BpmSimpleModelNodeTypeEnum implements IntArrayValuable {
|
||||
|
||||
// 0 ~ 1 开始和结束
|
||||
START_NODE(0, "开始", "startEvent"),
|
||||
@@ -37,7 +37,7 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
||||
ROUTER_BRANCH_NODE(54, "路由分支", "exclusiveGateway")
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeTypeEnum::getType).toArray();
|
||||
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
@@ -55,7 +55,7 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
||||
|| Objects.equals(ROUTER_BRANCH_NODE.getType(), type);
|
||||
}
|
||||
|
||||
public static BpmSimpleModelNodeType valueOf(Integer type) {
|
||||
public static BpmSimpleModelNodeTypeEnum valueOf(Integer type) {
|
||||
return ArrayUtil.firstMatch(nodeType -> nodeType.getType().equals(type), values());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmTriggerType implements IntArrayValuable {
|
||||
public enum BpmTriggerTypeEnum implements IntArrayValuable {
|
||||
|
||||
HTTP_REQUEST(1, "发起 HTTP 请求");
|
||||
|
||||
@@ -28,14 +28,14 @@ public enum BpmTriggerType implements IntArrayValuable {
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmTriggerType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmTriggerTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static BpmTriggerType typeOf(Integer type) {
|
||||
public static BpmTriggerTypeEnum typeOf(Integer type) {
|
||||
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmUserTaskRejectHandlerType implements IntArrayValuable {
|
||||
public enum BpmUserTaskRejectHandlerTypeEnum implements IntArrayValuable {
|
||||
|
||||
FINISH_PROCESS_INSTANCE(1, "终止流程"),
|
||||
RETURN_USER_TASK(2, "驳回到指定任务节点");
|
||||
@@ -22,9 +22,9 @@ public enum BpmUserTaskRejectHandlerType implements IntArrayValuable {
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskRejectHandlerType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskRejectHandlerTypeEnum::getType).toArray();
|
||||
|
||||
public static BpmUserTaskRejectHandlerType typeOf(Integer type) {
|
||||
public static BpmUserTaskRejectHandlerTypeEnum typeOf(Integer type) {
|
||||
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user