{"record":{"id":"d053f3dca36f6ba5","repo":"flowable/flowable-engine","slug":"no-execution-active-no-variables-can-be-created","errorCode":null,"errorMessage":"No execution active, no variables can be created","messagePattern":"No execution active, no variables can be created","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/el/NoExecutionVariableScope.java","lineNumber":220,"sourceCode":"    }\n\n    @Override\n    public boolean hasVariablesLocal() {\n        return false;\n    }\n\n    @Override\n    public boolean hasVariable(String variableName) {\n        return false;\n    }\n\n    @Override\n    public boolean hasVariableLocal(String variableName) {\n        return false;\n    }\n\n    public void createVariableLocal(String variableName, Object value) {\n        throw new UnsupportedOperationException(\"No execution active, no variables can be created\");\n    }\n\n    public void createVariablesLocal(Map<String, ? extends Object> variables) {\n        throw new UnsupportedOperationException(\"No execution active, no variables can be created\");\n    }\n\n    @Override\n    public void removeVariable(String variableName) {\n        throw new UnsupportedOperationException(\"No execution active, no variables can be removed\");\n    }\n\n    @Override\n    public void removeVariableLocal(String variableName) {\n        throw new UnsupportedOperationException(\"No execution active, no variables can be removed\");\n    }\n\n    @Override\n    public void removeVariables() {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/el/NoExecutionVariableScope.java#L202-L238","documentation":"NoExecutionVariableScope.createVariableLocal(name, value) always throws UnsupportedOperationException; unlike the interface setters, variable creation is an internal write that needs an execution to attach the new VariableInstanceEntity to. The stub deliberately rejects it because there is no execution active.","triggerScenarios":"Calling createVariableLocal(String, Object) on a NoExecutionVariableScope, typically from internal service code or delegates using the internal VariableScopeImpl.createVariableLocal API.","commonSituations":"Internal listeners or scripts resolving variables without an execution; test code; framework glue that assumes an ExecutionEntity is present.","solutions":["Provide a real execution-backed scope before creating variables","Create variables via RuntimeService/TaskService with an executionId/taskId","Intercept this scope type earlier in your code and fail with a clearer message"],"exampleFix":"// before\nscope.createVariableLocal(\"created\", Instant.now()); // throws\n// after\nexecutionEntity.createVariableLocal(\"created\", Instant.now());","handlingStrategy":"try-catch","validationCode":"if (scope instanceof NoExecutionVariableScope) {\n    throw new IllegalStateException(\"No execution: cannot create local variable\");\n}","typeGuard":"boolean canCreateVariables(VariableScope scope) {\n    return !(scope instanceof NoExecutionVariableScope);\n}","tryCatchPattern":"try {\n    scope.createVariableLocal(name, value);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"No execution active\")) {\n        // create via executionEntity or runtimeService instead\n    } else throw e;\n}","preventionTips":["Create variables only within an execution or task context","Check the scope class before internal createVariableLocal calls","Use setVariable on a DelegateExecution instead of raw creation APIs"],"tags":["variables","unsupported-operation","flowable"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}