{"record":{"id":"d158b4684e2b5cc8","repo":"flowable/flowable-engine","slug":"identityid-is-required-d158b4","errorCode":null,"errorMessage":"IdentityId is required.","messagePattern":"IdentityId is required\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceIdentityLinkResource.java","lineNumber":105,"sourceCode":"\n        if (restApiInterceptor != null) {\n            restApiInterceptor.deleteCaseInstanceIdentityLink(caseInstance, link);\n        }\n\n        if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family)) {\n            runtimeService.deleteGroupIdentityLink(caseInstance.getId(), identityId, type);\n            \n        } else {\n            runtimeService.deleteUserIdentityLink(caseInstance.getId(), identityId, type);\n        }\n    }\n\n    protected void validateIdentityLinkArguments(String family, String identityId, String type) {\n        if (family == null || (!CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && !CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family))) {\n            throw new FlowableIllegalArgumentException(\"Identity link family should be 'users' or 'groups'.\");\n        }\n        if (identityId == null) {\n            throw new FlowableIllegalArgumentException(\"IdentityId is required.\");\n        }\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"Type is required.\");\n        }\n    }\n\n    protected IdentityLink getIdentityLink(String identityId, String family, String type, String caseInstanceId) {\n        // Perhaps it would be better to offer getting a single identity link\n        // from the API\n        List<IdentityLink> allLinks = runtimeService.getIdentityLinksForCaseInstance(caseInstanceId);\n        for (IdentityLink link : allLinks) {\n            if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family) && identityId.equals(link.getUserId()) && link.getType().equals(type)) {\n                return link;\n            \n            } else if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && identityId.equals(link.getGroupId()) && link.getType().equals(type)) {\n                return link;\n            }\n        }","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceIdentityLinkResource.java#L87-L123","documentation":"validateIdentityLinkArguments requires a non-null identityId path variable identifying the user or group of the identity link. A null identityId throws FlowableIllegalArgumentException(\"IdentityId is required.\").","triggerScenarios":"GET or DELETE .../identitylinks/{family}/{identityId}/{type} with a missing/empty {identityId} path segment resolved to null by the caller.","commonSituations":"Template URLs left with unfilled placeholders; clients dropping the identity segment when building the URL programmatically.","solutions":["Supply the user or group id in the identityId path segment.","Validate the id is non-null before invoking the REST call.","Check URL templates are fully interpolated."],"exampleFix":"// before\ncall(\"/cmmn-runtime/case-instances/case-1/identitylinks/users//participant\")\n// after\ncall(\"/cmmn-runtime/case-instances/case-1/identitylinks/users/kermit/participant\")","handlingStrategy":"validation","validationCode":"// Java\nif (identityId == null || identityId.isEmpty()) {\n    throw new IllegalArgumentException(\"identityId is required\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert URL template placeholders are filled","Validate ids before building REST URLs","Log the final URL before sending for debugging"],"tags":["rest-api","identity-link","missing-argument","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}