{"record":{"id":"ef0d70366f1e896c","repo":"apache/dolphinscheduler","slug":"invalid-status-executiontype","errorCode":null,"errorMessage":"invalid status : <executionType>","messagePattern":"invalid status : <executionType>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WorkflowExecutionTypeEnum.java","lineNumber":55,"sourceCode":"    }\n\n    @EnumValue\n    private final int code;\n    private final String descp;\n\n    private static HashMap<Integer, WorkflowExecutionTypeEnum> EXECUTION_STATUS_MAP = new HashMap<>();\n\n    static {\n        for (WorkflowExecutionTypeEnum executionType : WorkflowExecutionTypeEnum.values()) {\n            EXECUTION_STATUS_MAP.put(executionType.code, executionType);\n        }\n    }\n\n    public static WorkflowExecutionTypeEnum of(int executionType) {\n        if (EXECUTION_STATUS_MAP.containsKey(executionType)) {\n            return EXECUTION_STATUS_MAP.get(executionType);\n        }\n        throw new IllegalArgumentException(\"invalid status : \" + executionType);\n    }\n\n    public boolean isSerial() {\n        return this != PARALLEL;\n    }\n\n}\n","sourceCodeStart":37,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WorkflowExecutionTypeEnum.java#L37-L63","documentation":"WorkflowExecutionTypeEnum.of(int) maps a workflow execution-type code (SERIAL, PARALLEL, etc.) to the enum. It throws IllegalArgumentException when the executionType integer is not present in EXECUTION_STATUS_MAP, meaning the execution type code is unknown to this DolphinScheduler version.","triggerScenarios":"Calling WorkflowExecutionTypeEnum.of(executionType) with an int outside the enum's codes — typically when deserializing a workflow definition (e.g. from DB or imported JSON) whose executionType field holds an invalid/legacy value.","commonSituations":"Importing workflow definitions exported from a different version; hand-edited JSON/YAML definitions; DB migration gaps where execution_type column values were renamed.","solutions":["Check the executionType value against the enum's defined codes and use WorkflowExecutionTypeEnum constants or valueOf by name in code.","Re-export/re-import the workflow definition from a matching DolphinScheduler version, or fix the execution_type column to a valid code.","Validate definitions at import time: reject or default unknown executionType values before persistence."],"exampleFix":"// before\nWorkflowExecutionTypeEnum t = WorkflowExecutionTypeEnum.of(def.getExecutionType());\n\n// after\nWorkflowExecutionTypeEnum t = Arrays.stream(WorkflowExecutionTypeEnum.values())\n        .filter(e -> e.getCode() == def.getExecutionType())\n        .findFirst()\n        .orElseThrow(() -> new IllegalArgumentException(\n            \"Unknown workflow execution type: \" + def.getExecutionType() +\n            \" for workflow \" + def.getName()));","handlingStrategy":"validation","validationCode":"boolean isValidExecutionType(int code) {\n    return Arrays.stream(WorkflowExecutionTypeEnum.values()).anyMatch(e -> e.getCode() == code);\n}","typeGuard":null,"tryCatchPattern":"try {\n    WorkflowExecutionTypeEnum t = WorkflowExecutionTypeEnum.of(code);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Invalid executionType \" + code + \" in definition \" + name + \"; valid: \" + Arrays.toString(WorkflowExecutionTypeEnum.values()));\n}","preventionTips":["Use enum constants (WorkflowExecutionTypeEnum.SERIAL.getCode()) when building definitions.","Validate executionType at workflow import time before persisting.","Re-export definitions when moving between DolphinScheduler versions."],"tags":["enum","workflow","execution-type"],"backgroundTag":"invalid-enum-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}