flowable/flowable-engine · error · FlowableIllegalArgumentException

deploymentKeyLike is null

Error message

deploymentKeyLike is null

What it means

Flowable's DeploymentQuery rejects a null argument to deploymentKeyLike() because a null 'like' pattern is indistinguishable from 'no filter was set'. The library throws FlowableIllegalArgumentException to force the caller to either pass a real pattern or omit the call entirely.

Solutions

  1. Pass a non-null like pattern, e.g. deploymentKeyLike("%my-key%")
  2. Only call deploymentKeyLike when the value is non-null; otherwise skip the filter
  3. Validate/normalize the input before building the query

Example fix

// before
query.deploymentKeyLike(request.getKeyLike());
// after
if (request.getKeyLike() != null) {
    query.deploymentKeyLike(request.getKeyLike());
}
Defensive patterns

Strategy: validation

Validate before calling

if (keyLike == null) { throw new IllegalArgumentException("deploymentKeyLike is required"); }
query.deploymentKeyLike(keyLike);

Type guard

boolean hasDeploymentKeyLike(String s) { return s != null && !s.isEmpty(); }

Try / catch

try {
    query.deploymentKeyLike(keyLike);
} catch (FlowableIllegalArgumentException e) {
    // fall back to unfiltered query or rethrow with context
}

Prevention

When it happens

Trigger: Calling deploymentQuery.deploymentKeyLike(null), typically when the key-like value comes from a nullable variable, request parameter, or optional config.

Common situations: REST/service layers forwarding user-supplied filter params straight into the query builder; nullable fields in search DTOs; refactoring where a default value was removed.

Related errors


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

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/DeploymentQueryImpl.java:141

            throw new FlowableIllegalArgumentException("deploymentCategoryExclude is null");
        }
        this.categoryNotEquals = deploymentCategoryNotEquals;
        return this;
    }

    @Override
    public DeploymentQueryImpl deploymentKey(String deploymentKey) {
        if (deploymentKey == null) {
            throw new FlowableIllegalArgumentException("deploymentKey is null");
        }
        this.key = deploymentKey;
        return this;
    }

    @Override
    public DeploymentQueryImpl deploymentKeyLike(String deploymentKeyLike) {
        if (deploymentKeyLike == null) {
            throw new FlowableIllegalArgumentException("deploymentKeyLike is null");
        }
        this.keyLike = deploymentKeyLike;
        return this;
    }

    @Override
    public DeploymentQueryImpl deploymentTenantId(String tenantId) {
        if (tenantId == null) {
            throw new FlowableIllegalArgumentException("deploymentTenantId is null");
        }
        this.tenantId = tenantId;
        return this;
    }

    @Override
    public DeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {
        if (tenantIdLike == null) {
            throw new FlowableIllegalArgumentException("deploymentTenantIdLike is null");

View on GitHub (pinned to d6d39ce1c6)