{"record":{"id":"10b4d7fb363ad9b6","repo":"flowable/flowable-engine","slug":"event-type-is-null-10b4d7","errorCode":null,"errorMessage":"event type is null","messagePattern":"event type is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java","lineNumber":253,"sourceCode":"        return eventSubscription(\"signal\", signalName);\n    }\n\n    @Override\n    public ExecutionQuery signalEventSubscriptionName(String signalName) {\n        return eventSubscription(\"signal\", signalName);\n    }\n\n    @Override\n    public ExecutionQuery messageEventSubscriptionName(String messageName) {\n        return eventSubscription(\"message\", messageName);\n    }\n\n    public ExecutionQuery eventSubscription(String eventType, String eventName) {\n        if (eventName == null) {\n            throw new ActivitiIllegalArgumentException(\"event name is null\");\n        }\n        if (eventType == null) {\n            throw new ActivitiIllegalArgumentException(\"event type is null\");\n        }\n        if (eventSubscriptions == null) {\n            eventSubscriptions = new ArrayList<>();\n        }\n        eventSubscriptions.add(new EventSubscriptionQueryValue(eventName, eventType));\n        return this;\n    }\n\n    @Override\n    public ExecutionQuery processVariableValueEquals(String variableName, Object variableValue) {\n        return variableValueEquals(variableName, variableValue, false);\n    }\n\n    @Override\n    public ExecutionQuery processVariableValueEquals(Object variableValue) {\n        return variableValueEquals(variableValue, false);\n    }\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java#L235-L271","documentation":"ExecutionQuery.eventSubscription(eventType, eventName) requires both a non-null event type (e.g. ActivitiEventType, message/signal) and event name. The library throws ActivitiIllegalArgumentException when eventType is null because filtering by event subscription is meaningless without it, and the value is later written into the persisted query. This is fail-fast argument validation at query-construction time.","triggerScenarios":"Calling executionQuery.eventSubscription(null, \"someName\") — passing eventType as null while eventName is a valid string, often when the type is read from a variable or config that is missing.","commonSituations":"Dynamically built queries where the event type comes from a user request or properties file; refactorings where argument order (eventType, eventName) was swapped or one parameter dropped; variables that were expected to be initialized but stayed null.","solutions":["Pass a valid non-null eventType string as the first argument, e.g. eventSubscription(\"message\", \"myMessage\").","Check the argument order: the signature is eventSubscription(eventType, eventName); swap the arguments if you passed them reversed.","If the type is sourced dynamically, default it or throw your own descriptive error before calling.","Verify with unit coverage that the configured event type is never null before query execution."],"exampleFix":"// before\nString type = config.get(\"eventType\"); // null\nquery.eventSubscription(type, \"orderSignal\");\n// after\nString type = config.get(\"eventType\");\nif (type == null) type = \"signal\"; // or fail early\nquery.eventSubscription(type, \"orderSignal\");","handlingStrategy":"validation","validationCode":"if (eventType == null) throw new IllegalArgumentException(\"eventType must be non-null before eventSubscription()\");\nif (eventName == null) throw new IllegalArgumentException(\"eventName must be non-null before eventSubscription()\");","typeGuard":"boolean hasEventSubscription(String t, String n) { return t != null && n != null; }","tryCatchPattern":"try {\n    query.eventSubscription(eventType, eventName);\n} catch (ActivitiIllegalArgumentException e) {\n    if (e.getMessage().contains(\"event type is null\")) {\n        // fix inputs or fall back to non-event-subscription query\n    }\n}","preventionTips":["Remember argument order: (eventType, eventName).","Validate dynamic/config-sourced values before building queries.","Cover query construction in unit tests with null-input cases.","Prefer constants for known event types instead of ad-hoc strings."],"tags":["java","activiti","query","null-argument"],"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"}