flowable/flowable-engine · error · ActivitiIllegalArgumentException

categoryLike is null

Error message

categoryLike is null

What it means

ProcessDefinitionQueryImpl.processDefinitionCategoryLike(String) filters process definitions by category using a LIKE pattern. Flowable throws ActivitiIllegalArgumentException when the pattern is null, because the SQL LIKE clause requires a non-null string.

Source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java:105

    @Override
    public ProcessDefinitionQuery processDefinitionIds(Set<String> processDefinitionIds) {
        this.ids = processDefinitionIds;
        return this;
    }

    @Override
    public ProcessDefinitionQueryImpl processDefinitionCategory(String category) {
        if (category == null) {
            throw new ActivitiIllegalArgumentException("category is null");
        }
        this.category = category;
        return this;
    }

    @Override
    public ProcessDefinitionQueryImpl processDefinitionCategoryLike(String categoryLike) {
        if (categoryLike == null) {
            throw new ActivitiIllegalArgumentException("categoryLike is null");
        }
        this.categoryLike = categoryLike;
        return this;
    }

    @Override
    public ProcessDefinitionQueryImpl processDefinitionCategoryNotEquals(String categoryNotEquals) {
        if (categoryNotEquals == null) {
            throw new ActivitiIllegalArgumentException("categoryNotEquals is null");
        }
        this.categoryNotEquals = categoryNotEquals;
        return this;
    }

    @Override
    public ProcessDefinitionQueryImpl processDefinitionName(String name) {
        if (name == null) {
            throw new ActivitiIllegalArgumentException("name is null");

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a non-null pattern, e.g. "http://acme%".
  2. Null-check the pattern; omit processDefinitionCategoryLike() when not provided.
  3. Default the pattern to "%" to match all categories.
  4. Catch ActivitiIllegalArgumentException to handle bad query input centrally.

Example fix

// before
query.processDefinitionCategoryLike(categoryPattern); // may be null
// after
if (categoryPattern != null) {
    query.processDefinitionCategoryLike(categoryPattern);
}
Defensive patterns

Strategy: validation

Validate before calling

if (categoryLike != null && !categoryLike.isEmpty()) {
    query.processDefinitionCategoryLike(categoryLike);
}

Type guard

boolean hasCategoryPattern(String p) { return p != null && !p.isEmpty(); }

Try / catch

try {
    query.processDefinitionCategoryLike(categoryLike);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
    log.warn("Invalid categoryLike filter: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Calling processDefinitionQuery.processDefinitionCategoryLike(null), typically from an uninitialized or optional user-supplied pattern.

Common situations: Search UIs with an optional category-pattern field passed unconditionally; code refactors that removed a default pattern value.

Related errors


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