flowable/flowable-engine · error · UnsupportedOperationException
No execution active, no variables can be removed
Error message
No execution active, no variables can be removed
What it means
NoExecutionVariableScope.removeVariable(name) always throws UnsupportedOperationException because deleting a variable requires an execution or task that owns it; this stub has neither. The throw is deliberate design so accidental writes on a read-only, execution-less scope fail immediately.
Solutions
- Use an execution-backed scope or runtimeService.removeVariable(executionId, name)
- Guard removal with an instanceof NoExecutionVariableScope check
- Restrict NoExecutionVariableScope to read-only evaluation paths
Example fix
// before
scope.removeVariable("temp"); // throws
// after
runtimeService.removeVariable(executionId, "temp"); Defensive patterns
Strategy: try-catch
Validate before calling
if (scope instanceof NoExecutionVariableScope) {
throw new IllegalStateException("No execution: cannot remove variable " + name);
} Type guard
boolean supportsVariableRemoval(VariableScope scope) {
return !(scope instanceof NoExecutionVariableScope);
} Try / catch
try {
scope.removeVariable(name);
} catch (UnsupportedOperationException e) {
if (e.getMessage().contains("No execution active")) {
runtimeService.removeVariable(executionId, name);
} else throw e;
} Prevention
- Remove variables via runtimeService/taskService when no scope is active
- Never perform cleanup logic against NoExecutionVariableScope
- Guard generic VariableScope-handling code with instanceof checks
When it happens
Trigger: Calling removeVariable(String) on a NoExecutionVariableScope reference, e.g. from generic VariableScope-consuming code paths or listeners evaluated without an execution.
Common situations: Cleanup logic in delegates assuming an execution scope; standalone EL evaluation contexts; unit tests reusing the stub.
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 created
- No execution active, no variables can be created
- No execution active, no variables can be set
- 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/cd4ffac3cfb3fe88.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/el/NoExecutionVariableScope.java:229
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() {
throw new UnsupportedOperationException("No execution active, no variables can be removed");
}
@Override
public void removeVariablesLocal() {
throw new UnsupportedOperationException("No execution active, no variables can be removed");
}
@OverrideView on GitHub (pinned to d6d39ce1c6)