package org.springblade.flow.engine.enums;

/**
 * 请求方法的类型
 */
public enum FlowScriptTypeEnum {
    //没有经过
    GROOVY(0, "groovy"),
    //经过节点
    JAVASCRIPT(1, "JavaScript"),
    //当前节点
    JUEL(2, "JUEL");

    private Integer code;
    private String message;

    FlowScriptTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


    public static  String getMessageByIndex(Integer code){
        for (FlowScriptTypeEnum value : FlowScriptTypeEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }


}
