{"record":{"id":"42ca6dbbd1bfd169","repo":"flowable/flowable-engine","slug":"identitylinktype-is-null-42ca6d","errorCode":null,"errorMessage":"identityLinkType is null","messagePattern":"identityLinkType is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java","lineNumber":609,"sourceCode":"    }\n\n    @Override\n    public HistoricProcessInstanceQuery involvedUser(String involvedUser) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedUser = involvedUser;\n        } else {\n            this.involvedUser = involvedUser;\n        }\n        return this;\n    }\n    \n    @Override\n    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) {","sourceCodeStart":591,"sourceCodeEnd":627,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java#L591-L627","documentation":"HistoricProcessInstanceQuery.involvedUser(String userId, String identityLinkType) requires a non-null identityLinkType. Flowable throws FlowableIllegalArgumentException when the type is null, because the identity-link relation must know which link type (e.g. participant, assignee, candidate) to filter on.","triggerScenarios":"Calling involvedUser(userId, null) — e.g. the link type is read from a nullable config field, enum lookup that missed, or a caller simply forgot to pass it.","commonSituations":"Dynamic query builders parameterizing the link type from user input; mapping tables where a type key had no entry; refactors after renaming IdentityLinkType constants.","solutions":["Pass a valid identity link type string, e.g. IdentityLinkType.PARTICIPANT","Null-check before the call and apply a default type when absent","Validate user-supplied type values against the allowed Flowable identity link types","Drop the involvedUser criterion if no type can be determined"],"exampleFix":"// before\nquery.involvedUser(userId, type); // throws when type == null\n// after\nquery.involvedUser(userId, type != null ? type : IdentityLinkType.PARTICIPANT);","handlingStrategy":"validation","validationCode":"if (userId == null || identityLinkType == null) {\n    throw new IllegalArgumentException(\"userId and identityLinkType are required for involvedUser\");\n}\nquery.involvedUser(userId, identityLinkType);","typeGuard":"boolean isValidInvolvedUserArgs(String userId, String type) {\n    return userId != null && type != null && !type.trim().isEmpty();\n}","tryCatchPattern":"try {\n    query.involvedUser(userId, identityLinkType);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().equals(\"identityLinkType is null\")) {\n        query.involvedUser(userId, IdentityLinkType.PARTICIPANT); // default type\n    } else {\n        throw e;\n    }\n}","preventionTips":["Default identity link types with constants from IdentityLinkType","Validate user-supplied link-type strings against supported values","Centralize involvedUser calls in helpers that apply defaults","Cover link-type parameterization with unit tests"],"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"}