{"record":{"id":"0125386f99527c3e","repo":"flowable/flowable-engine","slug":"key-is-null-012538","errorCode":null,"errorMessage":"key is null","messagePattern":"key is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java","lineNumber":173,"sourceCode":"            throw new FlowableIllegalArgumentException(\"ids are null\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl parentDeploymentId(String parentDeploymentId) {\n        if (parentDeploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelDefinitionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");\n        }\n        this.key = key;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelDefinitionKeyLike(String keyLike) {\n        if (keyLike == null) {\n            throw new FlowableIllegalArgumentException(\"keyLike is null\");\n        }\n        this.keyLike = keyLike;\n        return this;\n    }\n    \n    @Override\n    public ChannelDefinitionQuery channelDefinitionKeyLikeIgnoreCase(String keyLikeIgnoreCase) {\n        if (keyLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"keyLikeIgnoreCase is null\");","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java#L155-L191","documentation":"ChannelDefinitionQueryImpl.channelDefinitionKey() throws FlowableIllegalArgumentException when the key argument is null. The query API requires an exact key string to filter channel definitions; null is rejected at build time so the error surfaces immediately at the call site instead of as an empty or malformed database query.","triggerScenarios":"Calling channelDefinitionQuery().channelDefinitionKey(null), usually because the key variable originates from a model, event registry model, or config value that is unset/null.","commonSituations":"Looking up a channel definition whose key was never configured; typos leading to a null lookup result passed onward; deserialization of a channel model that omitted the key field.","solutions":["Pass the actual channel definition key string","Guard the call site: only call channelDefinitionKey(key) when key != null","If a partial match is intended, use channelDefinitionKeyLike(keyPattern) with a non-null pattern","Verify the source of the key (config file, model JSON) actually contains the key property"],"exampleFix":"// before\nString key = channelModel.getKey(); // may be null\nquery.channelDefinitionKey(key);\n// after\nif (channelModel.getKey() != null) {\n    query.channelDefinitionKey(channelModel.getKey());\n} else {\n    throw new IllegalStateException(\"Channel key is required\");\n}","handlingStrategy":"validation","validationCode":"if (key == null || key.isBlank()) {\n    throw new IllegalArgumentException(\"channelDefinitionKey is required\");\n}\nquery.channelDefinitionKey(key);","typeGuard":"boolean hasKey(String key) {\n    return key != null && !key.isBlank();\n}","tryCatchPattern":"try {\n    query.channelDefinitionKey(key);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ConfigurationException(\"Channel key not configured: \" + e.getMessage(), e);\n}","preventionTips":["Ensure channel models/config define the key field before querying by it","Prefer omitting the filter over passing null","Use channelDefinitionKeyLike for partial matches instead of constructing keys dynamically","Fail fast in configuration loading so null keys never reach query builders"],"tags":["flowable","null-argument","query-builder","validation"],"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"}