flowable/flowable-engine · error · FlowableIllegalArgumentException

Deployment id is null

Error message

Deployment id is null

What it means

SetDeploymentCategoryCmd changes the category of a DMN deployment. It validates that deploymentId is non-null, throwing FlowableIllegalArgumentException ('Deployment id is null') when it is not, before attempting any lookup.

Solutions

  1. Provide a non-null deployment id from DmnRepositoryService.createDeploymentQuery() results
  2. Validate the id at the call site before invoking setDeploymentCategory
  3. Trace why the earlier deployment lookup returned null

Example fix

// before
repositoryService.setDeploymentCategory(deploymentId, "cat");
// after
Objects.requireNonNull(deploymentId, "deploymentId required");
repositoryService.setDeploymentCategory(deploymentId, "cat");
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId == null || deploymentId.isEmpty()) {
    throw new IllegalArgumentException("deploymentId required");
}

Type guard

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

Try / catch

try {
    repositoryService.setDeploymentCategory(deploymentId, category);
} catch (FlowableIllegalArgumentException e) {
    log.error("Null deploymentId", e);
    throw new BadRequestException("deploymentId required");
}

Prevention

When it happens

Trigger: Calling dmnRepositoryService.setDeploymentCategory(null, category) or new SetDeploymentCategoryCmd(null, category).

Common situations: Passing the result of a nullable deployment query, uninitialized configuration properties holding the deployment id, or variable shadowing leading to an unset id.

Related errors


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

Appendix: source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDeploymentCategoryCmd.java:39

/**
 * @author Tijs Rademakers
 */
public class SetDeploymentCategoryCmd implements Command<Void> {

    protected String deploymentId;
    protected String category;

    public SetDeploymentCategoryCmd(String deploymentId, String category) {
        this.deploymentId = deploymentId;
        this.category = category;
    }

    @Override
    public Void execute(CommandContext commandContext) {

        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("Deployment id is null");
        }

        DmnDeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId);

        if (deployment == null) {
            throw new FlowableObjectNotFoundException("No deployment found for id = '" + deploymentId + "'");
        }

        // Update category
        deployment.setCategory(category);
        CommandContextUtil.getDeploymentEntityManager(commandContext).update(deployment);

        return null;
    }

    public String getDeploymentId() {
        return deploymentId;
    }

View on GitHub (pinned to d6d39ce1c6)