{"record":{"id":"3993a8b334f97010","repo":"flowable/flowable-engine","slug":"identitylinktype-is-null","errorCode":null,"errorMessage":"identityLinkType is null","messagePattern":"identityLinkType 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":1098,"sourceCode":"    public HistoricCaseInstanceQuery 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 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) {","sourceCodeStart":1080,"sourceCodeEnd":1116,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L1080-L1116","documentation":"HistoricCaseInstanceQueryImpl.involvedUser(String userId, String identityLinkType) throws FlowableIllegalArgumentException(\"identityLinkType is null\") when the identity link type parameter is null. The type (e.g. participant, owner, assignee) is required to build the identity-link join predicate.","triggerScenarios":"Calling involvedUser(userId, null) on a HistoricCaseInstanceQuery — usually when the link type is read from config/enum mapping that returned null.","commonSituations":"An enum-to-string lookup or constants class returned null; a typo in the link-type constant reference; API clients passing an unrecognized type that got normalized to null.","solutions":["Pass a valid non-null identity link type constant (e.g. from IdentityLinkType).","Validate/normalize the link type string before calling; reject unknown values early.","If any link type should match, use plain involvedUser(userId) instead of the two-arg overload.","Fix enum/config mappings so they never yield null for known inputs."],"exampleFix":"// before\nquery.involvedUser(userId, linkType); // linkType may be null\n// after\nif (userId != null && linkType != null) {\n    query.involvedUser(userId, linkType);\n}","handlingStrategy":"validation","validationCode":"if (identityLinkType == null || identityLinkType.isEmpty()) {\n    throw new IllegalArgumentException(\"identityLinkType is required\");\n}\nquery.involvedUser(userId, identityLinkType);","typeGuard":"boolean isKnownLinkType(String type) {\n    return IdentityLinkType.PARTICIPANT.equals(type)\n        || IdentityLinkType.OWNER.equals(type)\n        || IdentityLinkType.ASSIGNEE.equals(type);\n}","tryCatchPattern":"try {\n    query.involvedUser(userId, identityLinkType);\n} catch (FlowableIllegalArgumentException e) {\n    if (\"identityLinkType is null\".equals(e.getMessage())) {\n        // use single-arg involvedUser(userId) or rethrow with context\n    } else {\n        throw e;\n    }\n}","preventionTips":["Map link types via enums/constants that cannot return null","Validate config-driven link types at startup","Reject unknown type strings early instead of normalizing to null","Add a documented default link type for optional configurations"],"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-14T11:17:12.474Z"}