flowable/flowable-engine · error · FlowableIllegalArgumentException

Deployment id is null

Error message

Deployment id is null

What it means

SetDeploymentCategoryCmd.execute throws FlowableIllegalArgumentException when deploymentId is null. The command needs the id to load the DeploymentEntity whose category will be changed. Pure argument-validation guard before any entity lookup.

Source

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

/**
 * @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");
        }

        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
        DeploymentEntity deployment = processEngineConfiguration.getDeploymentEntityManager().findById(deploymentId);

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

        if (Flowable5Util.isFlowable5Deployment(deployment, commandContext)) {
            processEngineConfiguration.getFlowable5CompatibilityHandler().setDeploymentCategory(deploymentId, category);
        }

        // Update category
        deployment.setCategory(category);

        FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();
        if (eventDispatcher != null && eventDispatcher.isEnabled()) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid deployment id string obtained from repositoryService.createDeploymentQuery() results.
  2. Check the id for null/blank before calling the API.
  3. Confirm the deployment actually completed so a real id exists.

Example fix

// before
repositoryService.setDeploymentCategory(deployId, "myCategory"); // deployId null
// after
if (deployId != null && !deployId.isEmpty()) {
    repositoryService.setDeploymentCategory(deployId, "myCategory");
}
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId == null || deploymentId.isEmpty()) {
    throw new IllegalArgumentException("deploymentId must be provided");
}
repositoryService.setDeploymentCategory(deploymentId, category);

Type guard

boolean isValidId = id != null && !id.trim().isEmpty();

Prevention

When it happens

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

Common situations: The deployment id variable was never assigned; forwarding the result of a failed lookup; building the command programmatically with an unset field.

Related errors


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