flowable/flowable-engine · error · FlowableIllegalArgumentException
type is required when deleting a process identity link
Error message
type is required when deleting a process identity link
What it means
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.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteIdentityLinkForCaseInstanceCmd.java:56
protected String groupId;
protected String type;
public DeleteIdentityLinkForCaseInstanceCmd(String caseInstanceId, String userId, String groupId, String type) {
validateParams(userId, groupId, caseInstanceId, type);
this.caseInstanceId = caseInstanceId;
this.userId = userId;
this.groupId = groupId;
this.type = type;
}
protected void validateParams(String userId, String groupId, String caseInstanceId, String type) {
if (caseInstanceId == null) {
throw new FlowableIllegalArgumentException("caseInstanceId is null");
}
if (type == null) {
throw new FlowableIllegalArgumentException("type is required when deleting a process identity link");
}
if (userId == null && groupId == null) {
throw new FlowableIllegalArgumentException("userId and groupId cannot both be null");
}
}
@Override
public Void execute(CommandContext commandContext) {
CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
CaseInstance caseInstance = cmmnEngineConfiguration.getCaseInstanceEntityManager().findById(caseInstanceId);
if (caseInstance == null) {
throw new FlowableObjectNotFoundException("Cannot find case instance with id " + caseInstanceId, CaseInstanceEntity.class);
}
IdentityLinkUtil.deleteCaseInstanceIdentityLinks(caseInstance, userId, groupId, type, cmmnEngineConfiguration);
View on GitHub (pinned to d6d39ce1c6)
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
Example fix
// before caseService.deleteCaseInstanceIdentityLink(caseInstanceId, userId, groupId, type); // after if (type == null) type = IdentityLinkType.PARTICIPANT; caseService.deleteCaseInstanceIdentityLink(caseInstanceId, userId, groupId, type);
Defensive patterns
Strategy: validation
Validate before calling
if (caseInstanceId == null || type == null) throw new IllegalArgumentException("caseInstanceId and type are required"); Type guard
boolean hasType = (type instanceof String) && !((String) type).isEmpty();
Prevention
- Always source link type from IdentityLinkType constants instead of free text
- Validate API request bodies for required fields before calling the engine
When it happens
Trigger: Calling CaseInstanceService.deleteCaseInstanceIdentityLink(caseInstanceId, userId, groupId, null) or equivalent RuntimeService/TaskService API where the type parameter is passed as null.
Common situations: 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.
Related errors
- userId and groupId cannot both be null
- appDefinitionId is null
- type is required when adding a new task identity link
- identityId is null
- Either set the user id or the group id for an identity link,
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/fe150e649382931b.
Report an issue: GitHub.