{"record":{"id":"df29ec699bcc56a3","repo":"flowable/flowable-engine","slug":"provided-event-name-is-null-df29ec","errorCode":null,"errorMessage":"Provided event name is null","messagePattern":"Provided event name is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/EventSubscriptionQueryImpl.java","lineNumber":57,"sourceCode":"    public EventSubscriptionQueryImpl(CommandContext commandContext) {\r\n        super(commandContext);\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl(CommandExecutor commandExecutor) {\r\n        super(commandExecutor);\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl eventSubscriptionId(String id) {\r\n        if (eventSubscriptionId == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Provided event subscription id is null\");\r\n        }\r\n        this.eventSubscriptionId = id;\r\n        return this;\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl eventName(String eventName) {\r\n        if (eventName == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Provided event name is null\");\r\n        }\r\n        this.eventName = eventName;\r\n        return this;\r\n    }\r\n\r\n    public EventSubscriptionQueryImpl executionId(String executionId) {\r\n        if (executionId == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Provided execution id is null\");\r\n        }\r\n        this.executionId = executionId;\r\n        return this;\r\n    }\r\n\r\n    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","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/EventSubscriptionQueryImpl.java#L39-L75","documentation":"Thrown by EventSubscriptionQueryImpl.eventName when a null event name is supplied as a query criterion. Activiti validates each query criterion setter argument immediately so invalid queries fail at construction, keeping the later executeQuery path free of null-filter edge cases. It indicates the caller passed a null filter value that the API does not accept.","triggerScenarios":"Calling runtimeService.createEventSubscriptionQuery().eventName(null), typically when the event name comes from a variable, message ref, or process variable that is null.","commonSituations":"Message/signal name read from configuration or a process variable that was never set; passing a result of a getEventName() on an entity that lacks a name; template-generated query code where the name parameter is optional but unconditionally passed.","solutions":["Guard the event name with a null check and only call eventName when non-null","Provide a concrete event name; if filtering by name is optional, omit the setter call","Correct the source of the name (config property, process variable) so it is populated before querying","If both name and id may be absent, decide the filtering strategy explicitly instead of passing null"],"exampleFix":"// before\nquery.eventName(eventName);\n// after\nif (eventName != null) {\n    query.eventName(eventName);\n}","handlingStrategy":"validation","validationCode":"if (eventName == null) { throw new IllegalArgumentException(\"eventName must be non-null before querying\"); }\nquery.eventName(eventName);","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.eventName(name);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    // name was null: supply a value or drop the criterion\n}","preventionTips":["Resolve message/signal names from config or process variables before building the query","Treat name-based filtering as optional and conditionally call the setter","Validate external inputs (request params) before mapping them to query criteria","Keep event name constants centralized to avoid unset values"],"tags":["java","activiti","query","null-check"],"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"}