{"record":{"id":"7594c3ef9d5fd5aa","repo":"flowable/flowable-engine","slug":"deploymenttenantid-is-null-7594c3","errorCode":null,"errorMessage":"deploymentTenantId is null","messagePattern":"deploymentTenantId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CmmnDeploymentQueryImpl.java","lineNumber":126,"sourceCode":"            throw new FlowableIllegalArgumentException(\"deploymentCategoryExclude is null\");\n        }\n        this.categoryNotEquals = deploymentCategoryNotEquals;\n        return this;\n    }\n    \n    @Override\n    public CmmnDeploymentQueryImpl deploymentKey(String deploymentKey) {\n        if (deploymentKey == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentKey is null\");\n        }\n        this.key = deploymentKey;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentTenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentTenantIdLike is null\");\n        }\n        this.tenantIdLike = tenantIdLike;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentWithoutTenantId() {\n        this.withoutTenantId = true;\n        return this;","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CmmnDeploymentQueryImpl.java#L108-L144","documentation":"Thrown by CmmnDeploymentQueryImpl.deploymentTenantId(null). Tenant filtering requires an explicit tenant id string; null is rejected so the generated query never contains a meaningless tenant predicate.","triggerScenarios":"Calling deploymentTenantId(null), usually when multi-tenant context resolution failed or the tenant id was never set on the request/context object.","commonSituations":"Multi-tenant applications where the tenant id is resolved at runtime; calling this setter from a non-tenant context; forgetting to use deploymentTenantIdLike for pattern matching.","solutions":["Pass a non-null tenant id string to deploymentTenantId()","Skip the call entirely when no tenant filtering is wanted","Check tenant resolution logic to ensure the id is populated before querying"],"exampleFix":"// before\nquery.deploymentTenantId(tenantId); // may be null\n// after\nif (tenantId != null) {\n    query.deploymentTenantId(tenantId);\n}","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(tenantId, \"deploymentTenantId must not be null\");\nquery.deploymentTenantId(tenantId);","typeGuard":"boolean hasTenant = tenantId != null && !tenantId.isEmpty();","tryCatchPattern":"try {\n    query.deploymentTenantId(tenantId);\n} catch (FlowableIllegalArgumentException e) {\n    // proceed without tenant filter or report missing tenant context\n}","preventionTips":["Resolve tenant context before building queries","Skip tenant setter when operating outside a tenant context","Consider TenantContext/ThreadLocal handling to avoid null tenant ids"],"tags":["java","flowable","null-check","multi-tenancy"],"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"}