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 is a VariableScope stub used when EL/expression evaluation happens without an active execution (e.g. outside a process instance). removeVariable is one of many mutating VariableScope methods deliberately unsupported here; calling it throws UnsupportedOperationException because there is no execution to hold variables.
Solutions
- Do not mutate variables on NoExecutionVariableScope; obtain the real ExecutionEntity/DelegateExecution and call its removeVariable
- Guard variable-mutation code with a check that the execution is active before calling removeVariable
- In tests, replace NoExecutionVariableScope with a mock/real VariableScope implementation before exercising variable APIs
- If you only need read access, use getVariable (returns null) instead of mutating APIs
Example fix
// before
scope.removeVariable("orderStatus"); // UnsupportedOperationException
// after
if (delegateExecution != null) {
delegateExecution.removeVariable("orderStatus");
} Defensive patterns
Strategy: try-catch
Validate before calling
if (scope instanceof NoExecutionVariableScope) {
throw new IllegalStateException("No execution active: cannot remove variable");
} Type guard
function hasActiveExecution(scope) {
return scope != null && !(scope instanceof NoExecutionVariableScope);
} Try / catch
try {
scope.removeVariable(name);
} catch (UnsupportedOperationException e) {
log.warn("No active execution; variable {} not removed", name, e);
} Prevention
- Only mutate variables from DelegateExecution/ExecutionEntity obtained in delegate or listener callbacks
- Never pass NoExecutionVariableScope into utility code that performs writes
- Check execution presence/active state before variable mutation
- In tests, use a concrete VariableScope implementation rather than the stub
When it happens
Trigger: Calling removeVariable(String) on a NoExecutionVariableScope instance, i.e. evaluating/removing variables in a context with no execution, such as expression evaluation outside a process or a custom delegate receiving this scope.
Common situations: Custom JavaDelegate/Expression code invoking variable mutations on the wrong scope object; reusing VariableScope references after the execution has ended; unit tests instantiating NoExecutionVariableScope and calling write APIs.
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
- Empty object, no variables can be created
- Empty object, no variables can be removed
- Empty object, no variables can be set
- This method is not supported in an OR statement
- Activity needed for multi instance cannot bv found
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/84f7bb423c7df18d.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/el/NoExecutionVariableScope.java:228
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)