flowable/flowable-engine · error · FlowableIllegalArgumentException

Variable name passed is null

Error message

Variable name passed is null

What it means

Helper getVariableValue in AbstractFlowableVariableExpressionFunction validates that the variable name argument passed to an EL function such as vars:get / vars:exists is non-null before reading it from the VariableContainer. A null name cannot identify any variable, so a FlowableIllegalArgumentException is thrown.

Solutions

  1. Pass a literal or non-null computed variable name to the EL function.
  2. Guard the argument in the expression, e.g. ${myName != null ? vars:get(myName) : null} or use vars:isEmpty with a literal name.
  3. Fix the upstream logic that produced a null name.
  4. In Java code calling the function helper directly, assert the name is non-null before invoking.

Example fix

// before (expression)
${vars:get(someNameThatMayBeNull)}

// after
${someNameThatMayBeNull != null ? vars:get(someNameThatMayBeNull) : null}
Defensive patterns

Strategy: validation

Validate before calling

Object name = resolveName(); // EL function argument
if (name == null) {
    return null; // or throw a domain-specific error before calling vars:get
}

Type guard

boolean isNonEmptyString(Object o) { return o instanceof String && !((String) o).isEmpty(); }

Try / catch

try {
    Object v = expressionManager.evaluateExpression(expr, execution);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage() != null && e.getMessage().contains("null")) {
        log.warn("EL function called with null variable name");
    }
    throw e;
}

Prevention

When it happens

Trigger: Evaluating an expression like ${vars:get(null)} or a function call where the variableName argument resolves to null (e.g. from another expression or variable that is null).

Common situations: Expression built dynamically where a name parameter variable is null at runtime; copy-paste/refactoring leaving a null literal as the function argument; chained expressions where an earlier lookup returned null and its result is used as the variable name.

Related errors


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

Appendix: source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/function/AbstractFlowableVariableExpressionFunction.java:104

    public Collection<String> localNames() {
        return functionNamesOptions;
    }

    @Override
    public Method functionMethod() {
        if (method != null) {
            return method;
        }

        method = findMethod(functionName);
        return method;
    }

    // Helper methods
    
    protected static Object getVariableValue(VariableContainer variableContainer, String variableName) {
        if (variableName == null) {
            throw new FlowableIllegalArgumentException("Variable name passed is null");
        }
        return variableContainer.getVariable(variableName);
    }
    
    protected static boolean valuesAreNumbers(Object variableValue, Object actualValue) {
        return actualValue instanceof Number && variableValue instanceof Number;
    }

    @Override
    public Collection<String> getFunctionNames() {
        Collection<String> functionNames = new LinkedHashSet<>();
        for (String functionPrefix : prefixes()) {
            for (String functionNameOption : localNames()) {
                functionNames.add(functionPrefix + ":" + functionNameOption);
            }
        }

        return functionNames;

View on GitHub (pinned to d6d39ce1c6)