flowable/flowable-engine · error · FlowableIllegalArgumentException
caseInstanceId is null
Error message
caseInstanceId is null
What it means
DeleteIdentityLinkForCaseInstanceCmd.validateParams throws FlowableIllegalArgumentException when caseInstanceId is null. Identity links on a case instance (e.g. participants) can only be removed for an identified case instance.
Solutions
- Pass the actual running case instance id, obtained from createCaseInstanceQuery() or the case execution context.
- Null-check the id at the call site before invoking the runtime service.
Example fix
// before
runtimeService.deleteUserIdentityLink(caseInstanceId, userId, IdentityLinkType.PARTICIPANT);
// after
if (caseInstanceId == null) throw new IllegalArgumentException("caseInstanceId required");
runtimeService.deleteUserIdentityLink(caseInstanceId, userId, IdentityLinkType.PARTICIPANT); Defensive patterns
Strategy: type-guard
Validate before calling
Objects.requireNonNull(caseInstanceId, "caseInstanceId is required");
Type guard
boolean hasInstanceId(String id) { return id != null && !id.trim().isEmpty(); } Try / catch
try { runtimeService.deleteUserIdentityLink(caseInstanceId, userId, type); } catch (FlowableIllegalArgumentException e) { log.error("Invalid case identity-link delete: {}", e.getMessage()); } Prevention
- Carry the caseInstanceId through context explicitly rather than reading nullable ambient state.
- Validate at API boundaries before invoking runtime service calls.
When it happens
Trigger: Calling CmmnRuntimeService.deleteUserIdentityLink/deleteGroupIdentityLink with a null caseInstanceId, typically from an unpopulated variable.
Common situations: Event-driven code where the case instance id is extracted from context that is absent (e.g. outside a case execution); forms submitted without the instance reference.
Related errors
- caseDefinitionId is null
- groupId is null
- groupIds are null
- identityLinkType is null
- involvedUser is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/c224c04c29e298d7.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteIdentityLinkForCaseInstanceCmd.java:52
private static final long serialVersionUID = 1L;
protected String caseInstanceId;
protected String userId;
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);View on GitHub (pinned to d6d39ce1c6)