{"record":{"id":"02515114e678ad0a","repo":"flowable/flowable-engine","slug":"form-tenantid-is-null-025151","errorCode":null,"errorMessage":"form tenantId is null","messagePattern":"form tenantId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventDefinitionQueryImpl.java","lineNumber":261,"sourceCode":"            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n        this.resourceName = resourceName;\n        return this;\n    }\n\n    @Override\n    public EventDefinitionQueryImpl eventDefinitionResourceNameLike(String resourceNameLike) {\n        if (resourceNameLike == null) {\n            throw new FlowableIllegalArgumentException(\"resourceNameLike is null\");\n        }\n        this.resourceNameLike = resourceNameLike;\n        return this;\n    }\n\n    @Override\n    public EventDefinitionQueryImpl tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"form tenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public EventDefinitionQueryImpl tenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"form tenantId is null\");\n        }\n        this.tenantIdLike = tenantIdLike;\n        return this;\n    }\n\n    @Override\n    public EventDefinitionQueryImpl withoutTenantId() {\n        this.withoutTenantId = true;\n        return this;","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventDefinitionQueryImpl.java#L243-L279","documentation":"EventDefinitionQueryImpl.tenantId sets an exact tenant filter on the event definition query. It throws FlowableIllegalArgumentException when tenantId is null; the message says 'form tenantId is null' (copied from the form module, but the check applies to the event definition tenantId).","triggerScenarios":"Calling tenantId(null) on the EventDefinitionQuery, usually because a tenant resolver returned null in a multi-tenant setup.","commonSituations":"Multi-tenant apps where the current tenant is not resolved (no tenant header/context), default-tenant configuration missing, calling the query outside a tenant-aware context.","solutions":["Pass the actual tenant id string the definitions were deployed with","If the tenant is unknown, omit the tenantId filter instead of passing null","Fix tenant resolution so a valid tenant id is available before querying"],"exampleFix":"// before\nquery.tenantId(currentTenant); // currentTenant may be null\n// after\nif (currentTenant != null) {\n    query.tenantId(currentTenant);\n}","handlingStrategy":"validation","validationCode":"if (tenantId == null || tenantId.isEmpty()) { throw new IllegalArgumentException(\"tenantId must be resolved before calling tenantId()\"); }","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try { query.tenantId(tenant); } catch (FlowableIllegalArgumentException e) { log.warn(\"tenant null, running unfiltered query\"); }","preventionTips":["Resolve the tenant from context (header/ThreadLocal) before querying and fail fast if missing","Omit tenant filters deliberately instead of passing null for 'all tenants'","Document the expected default tenant id in configuration"],"tags":["flowable","query","null-argument","tenant","event-registry"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}