flowable/flowable-engine · error · UnsupportedOperationException

No execution active, no variables can be created

Error message

No execution active, no variables can be created

What it means

createVariableLocal on NoExecutionVariableScope throws UnsupportedOperationException with a 'cannot be created' message: creating (as opposed to setting) variables requires a backing execution, which this placeholder scope lacks.

Solutions

  1. Create the variable on an active ExecutionEntity/DelegateExecution via createVariableLocal
  2. Move creation logic into a listener/service task executing within the process instance
  3. Guard creation calls with a scope-type check when context can be transient
  4. In tests, provide a mocked execution scope rather than NoExecutionVariableScope

Example fix

// before
scope.createVariableLocal("var", value);
// after
executionEntity.createVariableLocal("var", value);
Defensive patterns

Strategy: type-guard

Validate before calling

if (scope instanceof NoExecutionVariableScope) {
  throw new IllegalStateException("Cannot create variable " + name + " without an execution");
}

Type guard

boolean canCreateVariables(VariableScope scope) {
  return !(scope instanceof NoExecutionVariableScope);
}

Try / catch

try {
  scope.createVariableLocal(name, value);
} catch (UnsupportedOperationException e) {
  logger.warn("Variable creation deferred: {}", name);
}

Prevention

When it happens

Trigger: Calling createVariableLocal(String, Object) on a NoExecutionVariableScope instance.

Common situations: Variable creation attempted during expression evaluation without an execution; helper utilities assuming an execution-scoped container.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/el/NoExecutionVariableScope.java:219

    }

    @Override
    public boolean hasVariablesLocal() {
        return false;
    }

    @Override
    public boolean hasVariable(String variableName) {
        return false;
    }

    @Override
    public boolean hasVariableLocal(String variableName) {
        return false;
    }

    public void createVariableLocal(String variableName, Object value) {
        throw new UnsupportedOperationException("No execution active, no variables can be created");
    }

    public void createVariablesLocal(Map<String, ? extends Object> variables) {
        throw new UnsupportedOperationException("No execution active, no variables can be created");
    }

    @Override
    public void removeVariable(String variableName) {
        throw new UnsupportedOperationException("No execution active, no variables can be removed");
    }

    @Override
    public void removeVariableLocal(String variableName) {
        throw new UnsupportedOperationException("No execution active, no variables can be removed");
    }

    @Override
    public void removeVariables() {

View on GitHub (pinned to d6d39ce1c6)