{"record":{"id":"4a491b55ede494b7","repo":"flowable/flowable-engine","slug":"groupid-is-null-4a491b","errorCode":null,"errorMessage":"groupId is null","messagePattern":"groupId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java","lineNumber":622,"sourceCode":"    public HistoricProcessInstanceQuery 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 HistoricProcessInstanceQuery 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 HistoricProcessInstanceQuery involvedGroups(Set<String> involvedGroups) {\n        if (involvedGroups == null) {\n            throw new FlowableIllegalArgumentException(\"involvedGroups are null\");\n        }\n        if (involvedGroups.isEmpty()) {","sourceCodeStart":604,"sourceCodeEnd":640,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java#L604-L640","documentation":"HistoricProcessInstanceQuery.involvedGroup(String groupId, String identityLinkType) requires a non-null groupId. Flowable throws FlowableIllegalArgumentException when groupId is null, as an identity-link group filter without a group id is undefined. Validation is fail-fast at query-build time.","triggerScenarios":"Calling involvedGroup(null, identityLinkType) — e.g. group id resolved from user membership lookup that returned null, or a nullable request parameter.","commonSituations":"Multi-tenant/authorization filtering where the caller's group is unknown; group synchronization jobs that haven't run; forwarding optional group parameters from controllers.","solutions":["Pass a non-null groupId string to involvedGroup","Null-check the group id first and skip the criterion or use an alternate query when absent","Resolve the group from the authenticated user's memberships before building the query","Use involvedGroups(Set) instead if multiple candidate groups exist"],"exampleFix":"// before\nquery.involvedGroup(groupId, IdentityLinkType.PARTICIPANT); // throws when groupId == null\n// after\nif (groupId != null) {\n    query.involvedGroup(groupId, IdentityLinkType.PARTICIPANT);\n}","handlingStrategy":"validation","validationCode":"if (groupId == null) {\n    throw new IllegalArgumentException(\"groupId is required for involvedGroup filter\");\n}\nquery.involvedGroup(groupId, IdentityLinkType.PARTICIPANT);","typeGuard":"boolean isValidGroupId(String groupId) {\n    return groupId != null && !groupId.trim().isEmpty();\n}","tryCatchPattern":"try {\n    query.involvedGroup(groupId, identityLinkType);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().equals(\"groupId is null\")) {\n        // fall back to a query without the involvedGroup criterion\n    } else {\n        throw e;\n    }\n}","preventionTips":["Resolve group memberships before building group-scoped queries","Null-check group ids at the service boundary","Return empty collections (not null) from membership lookups","Make groupId a required parameter in wrapper APIs"],"tags":["flowable","null-check","identity-link","query-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-14T05:17:10.506Z"}