flowable/flowable-engine · error · ActivitiIllegalArgumentException

processDefinitionId is null

Error message

processDefinitionId is null

What it means

DeleteIdentityLinkForProcessDefinitionCmd removes a start-form/candidate-starter style identity link from a process definition. validateParams rejects a null processDefinitionId with ActivitiIllegalArgumentException because the target definition must be identified before any link can be removed.

Solutions

  1. Resolve the definition id first (repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult().getId()).
  2. Guard the call site to skip when the id is null.
  3. Ensure you pass the process DEFINITION id, not the deployment id or instance id.

Example fix

// before
repositoryService.deleteCandidateStarterGroup(processDefinitionId, "sales");
// after
if (processDefinitionId != null) {
    repositoryService.deleteCandidateStarterGroup(processDefinitionId, "sales");
}
Defensive patterns

Strategy: validation

Validate before calling

if (processDefinitionId == null) {
    return; // or resolve from key: createProcessDefinitionQuery().processDefinitionKey(key).latestVersion()
}

Try / catch

try {
    repositoryService.deleteProcessDefinitionIdentityLink(defId, userId, groupId);
} catch (ActivitiIllegalArgumentException e) {
    log.warn("Invalid definition identity-link delete: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Calling repositoryService.deleteProcessDefinitionIdentityLink / deleteCandidateStarterGroup/User (this command) with a null processDefinitionId.

Common situations: Deployment tooling where the definition id came from an optional lookup that returned null; scripts operating on definitions by key instead of id and leaving the id unset; CI cleanup steps after failed deployments.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/DeleteIdentityLinkForProcessDefinitionCmd.java:47

    private static final long serialVersionUID = 1L;

    protected String processDefinitionId;

    protected String userId;

    protected String groupId;

    public DeleteIdentityLinkForProcessDefinitionCmd(String processDefinitionId, String userId, String groupId) {
        validateParams(userId, groupId, processDefinitionId);
        this.processDefinitionId = processDefinitionId;
        this.userId = userId;
        this.groupId = groupId;
    }

    protected void validateParams(String userId, String groupId, String processDefinitionId) {
        if (processDefinitionId == null) {
            throw new ActivitiIllegalArgumentException("processDefinitionId is null");
        }

        if (userId == null && groupId == null) {
            throw new ActivitiIllegalArgumentException("userId and groupId cannot both be null");
        }
    }

    @Override
    public Void execute(CommandContext commandContext) {
        ProcessDefinitionEntity processDefinition = commandContext
                .getProcessDefinitionEntityManager()
                .findProcessDefinitionById(processDefinitionId);

        if (processDefinition == null) {
            throw new ActivitiObjectNotFoundException("Cannot find process definition with id " + processDefinitionId, ProcessDefinition.class);
        }

        processDefinition.deleteIdentityLink(userId, groupId);

View on GitHub (pinned to d6d39ce1c6)