flowable/flowable-engine · error · FlowableIllegalArgumentException

decisionDefinitionId is null

Error message

decisionDefinitionId is null

What it means

HistoricDecisionExecutionQueryImpl.decisionDefinitionId(String) throws FlowableIllegalArgumentException when the id argument is null. Historic DMN decision execution queries validate every filter id at the builder call; a null decision definition id would produce an invalid or overly broad query, so it is rejected immediately.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java:81

        super(commandExecutor);
    }

    @Override
    public DmnHistoricDecisionExecutionQuery id(String id) {
        this.id = id;
        return this;
    }

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

    @Override
    public DmnHistoricDecisionExecutionQuery decisionDefinitionId(String decisionDefinitionId) {
        if (decisionDefinitionId == null) {
            throw new FlowableIllegalArgumentException("decisionDefinitionId is null");
        }
        this.decisionDefinitionId = decisionDefinitionId;
        return this;
    }
    
    @Override
    public DmnHistoricDecisionExecutionQuery deploymentId(String deploymentId) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("deploymentId is null");
        }
        this.deploymentId = deploymentId;
        return this;
    }
    
    @Override
    public DmnHistoricDecisionExecutionQuery decisionKey(String decisionKey) {
        if (decisionKey == null) {
            throw new FlowableIllegalArgumentException("decisionKey is null");

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Resolve the decision definition id first via dmnRepositoryService.createDecisionDefinitionQuery() and confirm it is non-null
  2. Only apply decisionDefinitionId(...) when a valid id is available; otherwise omit the filter
  3. Add an explicit null guard at the call site with a domain-level error message

Example fix

// before
query.decisionDefinitionId(definition.getId()); // getId() may be null
// after
DecisionDefinition def = repoService.createDecisionDefinitionQuery()
    .decisionDefinitionKey(key).singleResult();
if (def != null) {
    query.decisionDefinitionId(def.getId());
}
Defensive patterns

Strategy: validation

Validate before calling

if (decisionDefinitionId == null) { throw new IllegalArgumentException("decisionDefinitionId must be resolved before querying history"); }

Type guard

boolean hasDefinitionId(DecisionDefinition d) { return d != null && d.getId() != null; }

Try / catch

try { query.decisionDefinitionId(defId); } catch (FlowableIllegalArgumentException e) { throw new IllegalStateException("Unknown decision definition: " + defId, e); }

Prevention

When it happens

Trigger: Calling dmnHistoryService.createHistoricDecisionExecutionQuery().decisionDefinitionId(null), usually when the definition id comes from an unresolved variable, a failed repository lookup, or an optional request parameter.

Common situations: Auditing dashboards that filter by decision definition where the definition was undeployed or its id was never captured; passing the result of a definition query by key that matched nothing; refactors that changed id sources.

Related errors


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