flowable/flowable-engine · error · IllegalArgumentException

Variable id cannot be empty

Error message

Variable id cannot be empty

What it means

ELExecutionContext.checkExecutionContext throws plain IllegalArgumentException when the variable id passed during EL expression evaluation is empty. It protects the DMN expression-evaluation context from resolving blank variable names.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ELExecutionContext.java:41

/**
 * @author Yvo Swillens
 */
public class ELExecutionContext {

    protected Map<Integer, Map<String, Object>> ruleResults = new LinkedHashMap<>();
    protected Map<String, Object> stackVariables;
    protected DecisionExecutionAuditContainer auditContainer;
    protected Map<String, List<Object>> outputValues = new LinkedHashMap<>();
    protected BuiltinAggregator aggregator;
    protected String instanceId;
    protected String scopeType;
    protected String tenantId;
    protected boolean forceDMN11;

    public void checkExecutionContext(String variableId) {
        if (StringUtils.isEmpty(variableId)) {
            throw new IllegalArgumentException("Variable id cannot be empty");
        }
    }

    public void addRuleResult(int ruleNumber, String outputName, Object outputValue) {
        Map<String, Object> ruleResult;
        if (ruleResults.containsKey(ruleNumber)) {
            ruleResult = ruleResults.get(ruleNumber);
        } else {
            ruleResult = new HashMap<>();
            ruleResults.put(ruleNumber, ruleResult);
        }
        ruleResult.put(outputName, outputValue);
    }

    public void setStackVariables(Map<String, Object> variables) {
        this.stackVariables = variables;
    }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Fix the DMN XML so input expressions reference non-empty variable names (e.g. ${age} not ${} ).
  2. Validate the input-variable map: remove/repair entries with null or empty keys before executing the decision table.
  3. Catch IllegalArgumentException around decision execution and report the offending expression.
  4. Validate DMN files against the XSD before deployment to catch empty expressions early.

Example fix

// before
Map<String, Object> inputs = new HashMap<>();
inputs.put("", 42); // empty variable id
// after
Map<String, Object> inputs = new HashMap<>();
inputs.put("amount", 42);
Defensive patterns

Strategy: validation

Validate before calling

for (String key : executionInputVariables.keySet()) {
    if (key == null || key.trim().isEmpty()) {
        throw new IllegalArgumentException("Input variable id must be non-empty");
    }
}

Try / catch

try {
    dmnEngine.evaluateDecisionTableByKey("myTable", inputs);
} catch (IllegalArgumentException e) {
    if (e.getMessage().contains("Variable id")) { /* blank variable reference in DMN */ }
}

Prevention

When it happens

Trigger: Evaluating an input expression that references a variable whose id is null/empty — e.g. DMN XML with <input> expression text blank or whitespace, or a variable map with empty-string keys fed to the decision-table execution.

Common situations: Hand-written DMN expressions referencing variables never declared; generated DMN from tooling that emits empty variable names; programmatic execution with executionInputVariables built from a map containing empty keys.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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