package com.ruoyi.project.business.enums;

import com.ruoyi.common.exception.ServiceErrorException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum NodeTypeEnum {


    /**
     * 申请节点
     */
    PROMOTER(0),// 申请节点
    AUDITOR(1),// 审批节点
    CC(2),// 抄送节点
    CONDITION(3),// 条件节点
    ROUTER(4);// 路由节点

    private Integer value;

    public static NodeTypeEnum from(Integer value) {
        for (NodeTypeEnum nodeTypeEnum : values()) {
            if (nodeTypeEnum.getValue().equals(value)) {
                return nodeTypeEnum;
            }
        }
        throw new ServiceErrorException("非法节点类型状态");
    }
}
