{"record":{"id":"3f76dd963572e24a","repo":"flowable/flowable-engine","slug":"provided-event-type-is-null-3f76dd","errorCode":null,"errorMessage":"Provided event type is null","messagePattern":"Provided event type is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/EventSubscriptionQueryImpl.java","lineNumber":89,"sourceCode":"    public EventSubscriptionQueryImpl processInstanceId(String processInstanceId) {\r\n        if (processInstanceId == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Provided process instance id is null\");\r\n        }\r\n        this.processInstanceId = processInstanceId;\r\n        return this;\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl activityId(String activityId) {\r\n        if (activityId == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Provided activity id is null\");\r\n        }\r\n        this.activityId = activityId;\r\n        return this;\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl eventType(String eventType) {\r\n        if (eventType == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Provided event type is null\");\r\n        }\r\n        this.eventType = eventType;\r\n        return this;\r\n    }\r\n\r\n    public String getTenantId() {\r\n        return tenantId;\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl tenantId(String tenantId) {\r\n        this.tenantId = tenantId;\r\n        return this;\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl orderByCreated() {\r\n        return orderBy(EventSubscriptionQueryProperty.CREATED);\r\n    }\r\n\r","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/EventSubscriptionQueryImpl.java#L71-L107","documentation":"EventSubscriptionQueryImpl.eventType(String) throws ActivitiIllegalArgumentException when the caller passes a null event type. The Flowable query API validates required filter fields eagerly in the fluent setter so an invalid query fails immediately rather than producing a broken SQL query or empty results at list() time. An event type (e.g. 'signal', 'message') is mandatory to scope the event subscription query.","triggerScenarios":"Calling eventSubscriptionQuery().eventType(null) — typically eventType(variable) or eventType(someMap.get(key)) where the variable is null or the map lookup missed.","commonSituations":"Event type stored in configuration/properties that was never loaded; reflection or deserialization building queries from nullable DTO fields; a refactor renamed a constant so the lookup returns null.","solutions":["Pass a valid event type string, e.g. query.eventType(EventType.SIGNAL.name()) or a concrete literal like 'signal'.","Null-check or default the value before calling eventType(): if (type != null) query.eventType(type);","If the type comes from config, verify the configuration source is actually loaded and the key exists.","Catch ActivitiIllegalArgumentException to surface a clear message to the user instead of an ambiguous failure."],"exampleFix":"// before\nString type = props.getProperty(\"event.type\");\nEventSubscriptionQuery q = runtimeService.createEventSubscriptionQuery().eventType(type);\n\n// after\nString type = props.getProperty(\"event.type\");\nif (type == null) {\n    throw new ConfigurationException(\"event.type must be configured\");\n}\nEventSubscriptionQuery q = runtimeService.createEventSubscriptionQuery().eventType(type);","handlingStrategy":"validation","validationCode":"if (eventType == null || eventType.isEmpty()) {\n    throw new IllegalArgumentException(\"eventType must be a non-empty string before calling eventType()\");\n}\nruntimeService.createEventSubscriptionQuery().eventType(eventType);","typeGuard":"boolean isValidEventType(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.eventType(eventType);\n} catch (ActivitiIllegalArgumentException e) {\n    log.error(\"Invalid event subscription query: {}\", e.getMessage());\n    throw new BadRequestException(\"event type must not be null\", e);\n}","preventionTips":["Resolve event types from constants (org.flowable.eventregistry or EventType enum) rather than free-form strings.","Null-check values loaded from config or maps before feeding them into query builders.","Centralize query construction in a helper that validates filters first.","Never chain query setters directly off possibly-null lookups (e.g. map.get(key))."],"tags":["flowable","query-api","null-check","event-subscription"],"backgroundTag":"null-argument","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"}