{"record":{"id":"fdf642f727dc699d","repo":"flowable/flowable-engine","slug":"identitylinktype-is-null-fdf642","errorCode":null,"errorMessage":"identityLinkType is null","messagePattern":"identityLinkType 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":828,"sourceCode":"    public CaseInstanceQuery involvedUser(String userId) {\n        if (userId == null) {\n            throw new FlowableIllegalArgumentException(\"involvedUser is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedUser = userId;\n        } else {\n            this.involvedUser = userId;\n        }\n        return this;\n    }\n    \n    @Override\n    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) {","sourceCodeStart":810,"sourceCodeEnd":846,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L810-L846","documentation":"CaseInstanceQueryImpl.involvedUser(String userId, String identityLinkType) throws FlowableIllegalArgumentException when identityLinkType is null. The identity link type selects which kind of involvement (participant, owner, etc.) is matched, so a null type cannot form a valid filter.","triggerScenarios":"Calling involvedUser(\"someUser\", null), usually because the identity link type came from an unset enum-to-string mapping, missing request parameter, or uninitialized constant.","commonSituations":"Admin search screens with a 'relation type' dropdown left unselected; refactors where the type constant was renamed/removed; passing IdentityLinkType enum values without mapping them to their string representation.","solutions":["Pass a valid identity link type string (e.g. \"participant\", \"owner\") and validate it is non-null before the call.","If the type is optional, only apply the involvedUser filter when a type is chosen, otherwise fall back to the single-argument involvedUser(userId).","Fix the enum/string mapping so the type is always provided.","Reject the query request with a validation error naming the missing identityLinkType."],"exampleFix":"// before\nquery.involvedUser(userId, filter.getRelationType());\n// after\nif (filter.getRelationType() != null) {\n    query.involvedUser(userId, filter.getRelationType());\n} else {\n    query.involvedUser(userId);\n}","handlingStrategy":"validation","validationCode":"if (identityLinkType == null) {\n    throw new IllegalArgumentException(\"identityLinkType required (e.g. participant, owner)\");\n}\nquery.involvedUser(userId, identityLinkType);","typeGuard":"boolean isValidIdentityLinkType(String type) {\n    return type != null && Set.of(\"participant\", \"owner\", \"candidate\").contains(type);\n}","tryCatchPattern":"try {\n    query.involvedUser(userId, identityLinkType);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"identityLinkType missing, falling back to plain involvedUser\");\n    query.involvedUser(userId);\n}","preventionTips":["Default the identity link type to a known value when the caller omits it","Use an enum with a toString mapping instead of free-form strings","Validate relation-type inputs at the controller layer"],"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"}