flowable/flowable-engine · error · ActivitiIllegalArgumentException

process definition id is null

Error message

process definition id is null

What it means

GetProcessDefinitionInfoCmd returns process definition info as an ObjectNode. It validates the input and throws ActivitiIllegalArgumentException('process definition id is null') when processDefinitionId is null before consulting the deployment manager cache.

Source

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

import tools.jackson.databind.node.ObjectNode;

/**
 * @author Tijs Rademakers
 */
public class GetProcessDefinitionInfoCmd implements Command<ObjectNode>, Serializable {

    private static final long serialVersionUID = 1L;

    protected String processDefinitionId;

    public GetProcessDefinitionInfoCmd(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    @Override
    public ObjectNode execute(CommandContext commandContext) {
        if (processDefinitionId == null) {
            throw new ActivitiIllegalArgumentException("process definition id is null");
        }

        ObjectNode resultNode = null;
        DeploymentManager deploymentManager = commandContext.getProcessEngineConfiguration().getDeploymentManager();
        // make sure the process definition is in the cache
        deploymentManager.findDeployedProcessDefinitionById(processDefinitionId);
        ProcessDefinitionInfoCacheObject definitionInfoCacheObject = deploymentManager.getProcessDefinitionInfoCache().get(processDefinitionId);
        if (definitionInfoCacheObject != null) {
            resultNode = definitionInfoCacheObject.getInfoNode();
        }

        return resultNode;
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid process definition id from repositoryService.createProcessDefinitionQuery().list()/singleResult()
  2. Null-check the definition lookup result before calling getProcessDefinitionInfo
  3. Ensure the definition is deployed and its id (not key) is used

Example fix

// before
ProcessDefinition pd = repoService.createProcessDefinitionQuery()
    .processDefinitionKey("myProcess").singleResult();
Object info = runtimeService.getProcessDefinitionInfo(pd.getId()); // NPE/null if pd missing
// after
ProcessDefinition pd = repoService.createProcessDefinitionQuery()
    .processDefinitionKey("myProcess").latestVersion().singleResult();
Object info = pd != null ? runtimeService.getProcessDefinitionInfo(pd.getId()) : null;
Defensive patterns

Strategy: validation

Validate before calling

if (processDefinitionId == null) {
    throw new IllegalArgumentException("processDefinitionId must be provided");
}

Type guard

boolean hasDefinitionId(String id) { return id != null && !id.trim().isEmpty(); }

Try / catch

try {
    runtimeService.getProcessDefinitionInfo(processDefinitionId);
} catch (ActivitiIllegalArgumentException e) {
    // null definition id: bad request
}

Prevention

When it happens

Trigger: Calling RuntimeService/RepositoryService getProcessDefinitionInfo(null) style APIs, or building the command directly with a null id — usually a null result propagated from an earlier definition lookup.

Common situations: processDefinitionQuery().singleResult() returned null on an empty result; missing id in a REST payload; variable never initialised after a refactor.

Related errors


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