{"record":{"id":"d37a36e31e9ee819","repo":"flowable/flowable-engine","slug":"no-execution-active-no-variables-can-be-created-d37a36","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/flowable5-engine/src/main/java/org/activiti/engine/impl/el/NoExecutionVariableScope.java","lineNumber":219,"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":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/el/NoExecutionVariableScope.java#L201-L237","documentation":"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.","triggerScenarios":"Calling createVariableLocal(String, Object) on a NoExecutionVariableScope instance.","commonSituations":"Variable creation attempted during expression evaluation without an execution; helper utilities assuming an execution-scoped container.","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"],"exampleFix":"// before\nscope.createVariableLocal(\"var\", value);\n// after\nexecutionEntity.createVariableLocal(\"var\", value);","handlingStrategy":"type-guard","validationCode":"if (scope instanceof NoExecutionVariableScope) {\n  throw new IllegalStateException(\"Cannot create variable \" + name + \" without an execution\");\n}","typeGuard":"boolean canCreateVariables(VariableScope scope) {\n  return !(scope instanceof NoExecutionVariableScope);\n}","tryCatchPattern":"try {\n  scope.createVariableLocal(name, value);\n} catch (UnsupportedOperationException e) {\n  logger.warn(\"Variable creation deferred: {}\", name);\n}","preventionTips":["Create variables only within running process executions","Avoid exposing NoExecutionVariableScope to business code that creates variables","Use execution listeners for variable initialization"],"tags":["variables","execution","flowable","unsupported-operation"],"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"}