flowable/flowable-engine · error · FlowableIllegalArgumentException

process definition id is null

Error message

process definition id is null

What it means

SaveProcessDefinitionInfoCmd.execute throws FlowableIllegalArgumentException when the processDefinitionId supplied to the command is null. The command needs the id to look up or create the corresponding ProcessDefinitionInfoEntity, so a null id makes the operation meaningless. This is an argument-validation guard at the very start of the command.

Source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SaveProcessDefinitionInfoCmd.java:46

/**
 * @author Tijs Rademakers
 */
public class SaveProcessDefinitionInfoCmd implements Command<Void>, Serializable {

    private static final long serialVersionUID = 1L;

    protected String processDefinitionId;
    protected ObjectNode infoNode;

    public SaveProcessDefinitionInfoCmd(String processDefinitionId, ObjectNode infoNode) {
        this.processDefinitionId = processDefinitionId;
        this.infoNode = infoNode;
    }

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

        if (infoNode == null) {
            throw new FlowableIllegalArgumentException("process definition info node is null");
        }

        ProcessDefinitionInfoEntityManager definitionInfoEntityManager = CommandContextUtil.getProcessDefinitionInfoEntityManager(commandContext);
        ProcessDefinitionInfoEntity definitionInfoEntity = definitionInfoEntityManager.findProcessDefinitionInfoByProcessDefinitionId(processDefinitionId);
        if (definitionInfoEntity == null) {
            definitionInfoEntity = definitionInfoEntityManager.create();
            definitionInfoEntity.setProcessDefinitionId(processDefinitionId);
            CommandContextUtil.getProcessDefinitionInfoEntityManager().insertProcessDefinitionInfo(definitionInfoEntity);
        }

        try {
            ObjectWriter writer = CommandContextUtil.getProcessEngineConfiguration(commandContext).getObjectMapper().writer();
            CommandContextUtil.getProcessDefinitionInfoEntityManager().updateInfoJson(definitionInfoEntity.getId(), writer.writeValueAsBytes(infoNode));
        } catch (Exception e) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid, non-null process definition id string when calling saveProcessDefinitionInfo.
  2. Resolve the id first, e.g. via repositoryService.createProcessDefinitionQuery() ... singleResult().getId(), and check it for null before invoking.
  3. Ensure the process definition is actually deployed so a real id exists to pass.

Example fix

// before
managementService.saveProcessDefinitionInfo(null, infoNode);
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey("myProcess").latestVersion().singleResult();
if (pd != null) {
    managementService.saveProcessDefinitionInfo(pd.getId(), infoNode);
}
Defensive patterns

Strategy: validation

Validate before calling

if (processDefinitionId == null || processDefinitionId.isEmpty()) {
    throw new IllegalArgumentException("processDefinitionId must be provided");
}
managementService.saveProcessDefinitionInfo(processDefinitionId, infoNode);

Type guard

boolean hasId = id instanceof String && !((String) id).isEmpty();

Prevention

When it happens

Trigger: Calling managementService.saveProcessDefinitionInfo(null, infoNode) or constructing new SaveProcessDefinitionInfoCmd(null, infoNode) and executing it.

Common situations: Passing an unassigned/uninitialized variable as the process definition id; a lookup that returned null upstream and its result was forwarded without checking; programmatic API misuse where the id field was never set.

Related errors


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