{"record":{"id":"e3143ceef32c4a9e","repo":"flowable/flowable-engine","slug":"groupid-is-null-e3143c","errorCode":null,"errorMessage":"groupId is null","messagePattern":"groupId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java","lineNumber":841,"sourceCode":"    public CaseInstanceQuery involvedUser(String userId, String identityLinkType) {\n        if (userId == null) {\n            throw new FlowableIllegalArgumentException(\"userId is null\");\n        }\n        if (identityLinkType == null) {\n            throw new FlowableIllegalArgumentException(\"identityLinkType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedUserIdentityLink = new IdentityLinkQueryObject(userId, null, identityLinkType);\n        } else {\n            this.involvedUserIdentityLink = new IdentityLinkQueryObject(userId, null, identityLinkType);\n        }\n        return this;\n    }\n    \n    @Override\n    public CaseInstanceQuery involvedGroup(String groupId, String identityLinkType) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"groupId is null\");\n        }\n        if (identityLinkType == null) {\n            throw new FlowableIllegalArgumentException(\"identityLinkType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);\n        } else {\n            this.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery involvedGroups(Set<String> groupIds) {\n        if (groupIds == null) {\n            throw new FlowableIllegalArgumentException(\"involvedGroups are null\");\n        }\n        if (groupIds.isEmpty()) {","sourceCodeStart":823,"sourceCodeEnd":859,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L823-L859","documentation":"CaseInstanceQueryImpl.involvedGroup(String groupId, String identityLinkType) throws FlowableIllegalArgumentException when groupId is null. Group-based case involvement filtering requires a concrete group id to join against the identity link table; null is rejected at query build time.","triggerScenarios":"Calling involvedGroup(null, \"participant\") or forwarding a null group id from a tenant/group resolver or request payload.","commonSituations":"Multi-tenant applications where the user's group membership was not resolved (no group claim in the token); search forms where the group filter was not filled in but applied anyway.","solutions":["Validate groupId is non-null before calling involvedGroup and skip the filter when absent.","Resolve the caller's group(s) from the identity/tenant layer before building the query.","Use involvedGroups(Set<String>) with a populated set when multiple groups may apply.","Fix the upstream group-resolution code that returned null."],"exampleFix":"// before\nquery.involvedGroup(groupResolver.currentGroup(), \"participant\");\n// after\nString groupId = groupResolver.currentGroup();\nif (groupId != null) {\n    query.involvedGroup(groupId, \"participant\");\n}","handlingStrategy":"validation","validationCode":"if (groupId == null) {\n    throw new IllegalArgumentException(\"groupId must not be null for involvedGroup\");\n}\nquery.involvedGroup(groupId, identityLinkType);","typeGuard":"boolean hasGroup(String groupId) {\n    return groupId != null && !groupId.isBlank();\n}","tryCatchPattern":"try {\n    query.involvedGroup(groupId, type);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Group filter skipped: {}\", e.getMessage());\n}","preventionTips":["Resolve group membership before building the query; skip the filter if unresolved","Null-check group ids sourced from tokens, tenant resolvers, or request params","Prefer involvedGroups(Set) with a validated set when multiple groups apply"],"tags":["java","flowable","query-builder","null-check","identity-link"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}