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
- Create the variable on an active ExecutionEntity/DelegateExecution via createVariableLocal
- Move creation logic into a listener/service task executing within the process instance
- Guard creation calls with a scope-type check when context can be transient
- 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
- Create variables only within running process executions
- Avoid exposing NoExecutionVariableScope to business code that creates variables
- Use execution listeners for variable initialization
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
- No execution active, no variables can be set
- No execution active, no variables can be created
- No execution active, no variables can be removed
- No execution active, no variables can be set
- Setting variable is not supported for read only delegate…
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)