{"record":{"id":"c1b963d2c54a6c24","repo":"flowable/flowable-engine","slug":"invalid-event-type","errorCode":null,"errorMessage":"Invalid event-type: ","messagePattern":"Invalid event-type: ","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/delegate/event/FlowableEngineEventType.java","lineNumber":417,"sourceCode":"     * @return an array of FlowableEngineEventType based on the given string.\n     * @throws FlowableIllegalArgumentException\n     *             when one of the given string is not a valid type name\n     */\n    public static FlowableEngineEventType[] getTypesFromString(String string) {\n        List<FlowableEngineEventType> result = new ArrayList<>();\n        if (string != null && !string.isEmpty()) {\n            String[] split = StringUtils.split(string, \",\");\n            for (String typeName : split) {\n                boolean found = false;\n                for (FlowableEngineEventType type : values()) {\n                    if (typeName.equals(type.name())) {\n                        result.add(type);\n                        found = true;\n                        break;\n                    }\n                }\n                if (!found) {\n                    throw new FlowableIllegalArgumentException(\"Invalid event-type: \" + typeName);\n                }\n            }\n        }\n\n        return result.toArray(EMPTY_ARRAY);\n    }\n}\n","sourceCodeStart":399,"sourceCodeEnd":425,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/delegate/event/FlowableEngineEventType.java#L399-L425","documentation":"FlowableEngineEventType.getTypesFromString throws FlowableIllegalArgumentException(\"Invalid event-type: \" + typeName) when one of the comma/whitespace-separated type names given does not match any FlowableEngineEventType enum constant. It validates that every requested event type string corresponds to a known engine event before returning the typed array.","triggerScenarios":"Calling getTypesFromString(\"A,B,C\") (e.g. when subscribing an event listener) where any of the comma-separated tokens is misspelled, has wrong casing, or is not a FlowableEngineEventType name.","commonSituations":"Typo'd event names in process-engine configuration (e.g. listener registration via properties/YAML), custom event names assumed to exist, copying event-type strings from different Flowable versions where constants were renamed.","solutions":["Compare the offending type name against the FlowableEngineEventType enum constants and fix the spelling/casing","Only use event types defined in your Flowable version (check the enum source for renames between versions)","Trim whitespace and validate each token before calling getTypesFromString"],"exampleFix":"// before\nengine.getRuntimeService().addEventListener(listener, FlowableEngineEventType.getTypesFromString(\"ENTITY_CREATE,ENTITY_UPDATEE\"));\n// after\nString types = \"ENTITY_CREATE,ENTITY_UPDATED\";\nfor (String t : types.split(\",\")) {\n    FlowableEngineEventType.valueOf(t.trim()); // fail fast with a clear message\n}\nengine.getRuntimeService().addEventListener(listener, FlowableEngineEventType.getTypesFromString(types));","handlingStrategy":"validation","validationCode":"// validate each event type token against the enum before calling getTypesFromString\nfor (String token : typesString.split(\",\")) {\n    try {\n        FlowableEngineEventType.valueOf(token.trim());\n    } catch (IllegalArgumentException ex) {\n        throw new IllegalArgumentException(\"Unknown Flowable event type: \" + token);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    FlowableEngineEventType[] types = FlowableEngineEventType.getTypesFromString(configuredTypes);\n} catch (FlowableIllegalArgumentException e) {\n    LOGGER.error(\"Bad event type in config: {}\", e.getMessage());\n    throw new IllegalArgumentException(\"Fix event types in configuration\", e);\n}","preventionTips":["Use FlowableEngineEventType constants directly (e.g. FlowableEngineEventType.ENTITY_CREATED) instead of strings","Keep configured type strings in sync with the enum for your Flowable version","Split on commas and trim tokens; disallow unknown tokens at config load time","Add an integration test that parses all configured event type strings at startup"],"tags":["java","enum","validation","events"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}