{"record":{"id":"fe150e649382931b","repo":"flowable/flowable-engine","slug":"type-is-required-when-deleting-a-process-identity","errorCode":null,"errorMessage":"type is required when deleting a process identity link","messagePattern":"type is required when deleting a process identity link","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteIdentityLinkForCaseInstanceCmd.java","lineNumber":56,"sourceCode":"    protected String groupId;\n    protected String type;\n\n    public DeleteIdentityLinkForCaseInstanceCmd(String caseInstanceId, String userId, String groupId, String type) {\n        \n        validateParams(userId, groupId, caseInstanceId, type);\n        this.caseInstanceId = caseInstanceId;\n        this.userId = userId;\n        this.groupId = groupId;\n        this.type = type;\n    }\n\n    protected void validateParams(String userId, String groupId, String caseInstanceId, String type) {\n        if (caseInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"caseInstanceId is null\");\n        }\n\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"type is required when deleting a process identity link\");\n        }\n\n        if (userId == null && groupId == null) {\n            throw new FlowableIllegalArgumentException(\"userId and groupId cannot both be null\");\n        }\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        CaseInstance caseInstance = cmmnEngineConfiguration.getCaseInstanceEntityManager().findById(caseInstanceId);\n\n        if (caseInstance == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find case instance with id \" + caseInstanceId, CaseInstanceEntity.class);\n        }\n\n        IdentityLinkUtil.deleteCaseInstanceIdentityLinks(caseInstance, userId, groupId, type, cmmnEngineConfiguration);\n        ","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteIdentityLinkForCaseInstanceCmd.java#L38-L74","documentation":"FlowableIllegalArgumentException thrown by DeleteIdentityLinkForCaseInstanceCmd.validateParams when the identity-link 'type' argument is null. The CMMN engine requires the link type (e.g. participant, owner) to know which kind of process identity link to remove. It is an argument-validation guard before any persistence work happens.","triggerScenarios":"Calling CaseInstanceService.deleteCaseInstanceIdentityLink(caseInstanceId, userId, groupId, null) or equivalent RuntimeService/TaskService API where the type parameter is passed as null.","commonSituations":"Developers building custom identity-link management UIs who pass an unset form field for the link type; refactoring code that dropped the type argument; type not mapped from an enum before calling.","solutions":["Pass a non-null identity link type (e.g. IdentityLinkType.PARTICIPANT) when calling deleteCaseInstanceIdentityLink","Validate the type parameter for null before invoking the service call","Check that the enum/form value is converted to a String before passing"],"exampleFix":"// before\ncaseService.deleteCaseInstanceIdentityLink(caseInstanceId, userId, groupId, type);\n// after\nif (type == null) type = IdentityLinkType.PARTICIPANT;\ncaseService.deleteCaseInstanceIdentityLink(caseInstanceId, userId, groupId, type);","handlingStrategy":"validation","validationCode":"if (caseInstanceId == null || type == null) throw new IllegalArgumentException(\"caseInstanceId and type are required\");","typeGuard":"boolean hasType = (type instanceof String) && !((String) type).isEmpty();","tryCatchPattern":null,"preventionTips":["Always source link type from IdentityLinkType constants instead of free text","Validate API request bodies for required fields before calling the engine"],"tags":["cmmn","identity-link","null-argument","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-14T11:17:12.474Z"}