flowable/flowable-engine · error · FlowableIllegalArgumentException

caseInstanceId is required

Error message

caseInstanceId is required

What it means

GetHistoricIdentityLinksForCaseInstanceCmd retrieves historic identity links (users/groups involved) for a case instance. Its constructor throws FlowableIllegalArgumentException when caseInstanceId is null; Flowable validates command arguments at construction time to fail fast.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetHistoricIdentityLinksForCaseInstanceCmd.java:37

import org.flowable.cmmn.engine.impl.util.CommandContextUtil;
import org.flowable.common.engine.api.FlowableIllegalArgumentException;
import org.flowable.common.engine.api.scope.ScopeTypes;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.identitylink.api.history.HistoricIdentityLink;

/**
 * @author Tijs Rademakers
 */
public class GetHistoricIdentityLinksForCaseInstanceCmd implements Command<List<HistoricIdentityLink>>, Serializable {

    private static final long serialVersionUID = 1L;
    
    protected String caseInstanceId;

    public GetHistoricIdentityLinksForCaseInstanceCmd(String caseInstanceId) {
        if (caseInstanceId == null) {
            throw new FlowableIllegalArgumentException("caseInstanceId is required");
        }
        this.caseInstanceId = caseInstanceId;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public List<HistoricIdentityLink> execute(CommandContext commandContext) {
        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
        return (List) cmmnEngineConfiguration.getIdentityLinkServiceConfiguration().getHistoricIdentityLinkService()
                .findHistoricIdentityLinksByScopeIdAndScopeType(caseInstanceId, ScopeTypes.CMMN);
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Supply a valid non-null caseInstanceId.
  2. Validate the id at the service boundary before calling the history API.
  3. Confirm the source variable name actually holds the case instance id.

Example fix

// before
cmmnHistoryService.getHistoricIdentityLinksForCaseInstance(params.get("id"));
// after
String id = params.get("id");
if (id == null) {
    throw new IllegalArgumentException("caseInstanceId must be provided");
}
cmmnHistoryService.getHistoricIdentityLinksForCaseInstance(id);
Defensive patterns

Strategy: validation

Validate before calling

if (caseInstanceId == null || caseInstanceId.isEmpty()) { throw new IllegalArgumentException("caseInstanceId must be provided"); }

Type guard

boolean isNonEmptyId = s != null && !s.isEmpty();

Try / catch

try { ... } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(e.getMessage()); }

Prevention

When it happens

Trigger: Calling new GetHistoricIdentityLinksForCaseInstanceCmd(null) or a service API (e.g. CmmnHistoryService) forwarding a null caseInstanceId from a nullable variable or request parameter.

Common situations: Id taken from a process/param map that lacks the key, confusing caseInstanceId with caseDefinitionId, or null from a prior query result.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/62913b1e6f040998. Report an issue: GitHub.