{"record":{"id":"3692e02798786dca","repo":"flowable/flowable-engine","slug":"groupid-is-null","errorCode":null,"errorMessage":"groupId is null","messagePattern":"groupId is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":1111,"sourceCode":"    public HistoricCaseInstanceQuery 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 HistoricCaseInstanceQuery 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 HistoricCaseInstanceQuery involvedGroups(Set<String> groupIds) {\n        if (groupIds == null) {\n            throw new FlowableIllegalArgumentException(\"groupIds are null\");\n        }\n        if (groupIds.isEmpty()) {","sourceCodeStart":1093,"sourceCodeEnd":1129,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L1093-L1129","documentation":"HistoricCaseInstanceQueryImpl.involvedGroup(String groupId, String identityLinkType) throws FlowableIllegalArgumentException(\"groupId is null\") when the groupId parameter is null. Group-based involvement filters require an actual group id combined with a link type to build the identity-link predicate.","triggerScenarios":"Calling involvedGroup(null, identityLinkType) on a HistoricCaseInstanceQuery before executing the query.","commonSituations":"Group id resolved from user memberships was empty (user in no group) and surfaced as null; tenant/group config missing; refactoring where the group id variable was dropped.","solutions":["Check groupId for null before calling involvedGroup.","Handle the no-group case explicitly (skip the filter or use a user-based filter instead).","Remember the same method also throws \"identityLinkType is null\" — validate both parameters.","Ensure group-resolution helpers never return null; return an empty collection and branch on it."],"exampleFix":"// before\nquery.involvedGroup(groupId, IdentityLinkType.PARTICIPANT); // groupId may be null\n// after\nif (groupId != null) {\n    query.involvedGroup(groupId, IdentityLinkType.PARTICIPANT);\n}","handlingStrategy":"validation","validationCode":"if (groupId == null || groupId.isEmpty()) {\n    throw new IllegalArgumentException(\"groupId is required\");\n}\nif (identityLinkType == null) {\n    throw new IllegalArgumentException(\"identityLinkType is required\");\n}\nquery.involvedGroup(groupId, identityLinkType);","typeGuard":"boolean canFilterByGroupLink(String groupId, String type) {\n    return groupId != null && type != null;\n}","tryCatchPattern":"try {\n    query.involvedGroup(groupId, identityLinkType);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"is null\")) {\n        // skip group filter or rethrow with context\n    } else {\n        throw e;\n    }\n}","preventionTips":["Check group membership results before filtering; empty memberships mean no group id","Validate both groupId and identityLinkType before the call","Handle users with no groups with an explicit alternate query path","Source group ids from a resolver that surfaces empty results, not null"],"tags":["java","flowable","cmmn","query","null-argument","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"}