{"record":{"id":"d85a286d74307382","repo":"flowable/flowable-engine","slug":"type-is-required","errorCode":null,"errorMessage":"Type is required.","messagePattern":"Type is required\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":409,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceIdentityLinkResource.java","lineNumber":108,"sourceCode":"        }\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        }\n        throw new FlowableObjectNotFoundException(\"Could not find the requested identity link.\", IdentityLink.class);\n    }\n}","sourceCodeStart":90,"sourceCodeEnd":126,"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#L90-L126","documentation":"Guard in CaseInstanceIdentityLinkResource.validateIdentityLinkArguments: family and identityId passed their checks but the identity link type is null; deleting or creating an identity link requires the link type (assignee, candidate, ...).","triggerScenarios":"GET or DELETE .../identitylinks/{family}/{identityId}/{type} with the {type} segment missing or not supplied by the caller.","commonSituations":"Omitting the type segment assuming it is optional; URL templates with unfilled placeholders; client methods with defaults that pass null.","solutions":["Include the identity link type in the URL, e.g. 'participant'.","Validate the type is non-null before the call.","Use the same type string that was used when the identity link was created."],"exampleFix":"// before\nDELETE /cmmn-runtime/case-instances/case-1/identitylinks/users/kermit\n// after\nDELETE /cmmn-runtime/case-instances/case-1/identitylinks/users/kermit/participant","handlingStrategy":"validation","validationCode":"// Java\nif (type == null || type.isEmpty()) {\n    throw new IllegalArgumentException(\"identity link type path segment is required\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always append the type segment used at link creation","Reuse the same type constants between create/get/delete calls","Document the full URL shape for identity-link endpoints"],"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"}