package com.qqchen.deploy.backend.workflow.enums;

import lombok.Getter;

@Getter
public enum GatewayTypeEnums {


    EXCLUSIVE_GATEWAY("exclusiveGateway", "排他网关"),
    PARALLEL_GATEWAY("parallelGateway", "并行网关"),
    INCLUSIVE_GATEWAY("inclusiveGateway", "包容网关");

    private final String code;

    private final String name;

    GatewayTypeEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static GatewayTypeEnums fromCode(String code) {
        for (GatewayTypeEnums status : GatewayTypeEnums.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid gateway type enums code: " + code);
    }
}
